The prior test patched _load_metadata as a plain no-op, so __init__'s try
block succeeded and never entered the except branch where the
repo_type != "bucket" guard and get_safe_version live - the assertion passed
vacuously (verified: it still passed with the guard removed).
Use side_effect=[FileNotFoundError, None] so the first _load_metadata raises
(forcing the except path) and the second succeeds after the meta pull, and
stub _pull_from_repo so the path runs without a network call. Now the test
fails if the bucket guard is removed. Thanks @mohitydv09 for the catch.
Signed-off-by: Sundar Raghavan <sdraghav@amazon.com>
Add an opt-in repo_type="bucket" parameter to StreamingLeRobotDataset
and LeRobotDatasetMetadata so a dataset can be streamed directly from an
HF Storage Bucket (hf://buckets/...) with no local download.
When repo_type="bucket":
- skip git-version resolution (buckets have no refs/tags),
- pull the meta/ directory via HfFileSystem.get,
- point url_root at hf://buckets/{repo_id},
- read parquet shards via load_dataset("parquet",
data_files="hf://buckets/{repo_id}/data/*/*.parquet", ...).
The default repo_type="dataset" preserves all existing behavior.
LeRobotDataset (non-streaming) and create() are unchanged.
Closes#3969
Signed-off-by: Sundar Raghavan <sdraghav@amazon.com>
* chore: replace hard-coded 'action' values with constants throughout all the source code
* chore(tests): replace hard-coded action values with constants throughout all the test code