feat(datasets): override + require non-empty robot_type/control_mode#220
Merged
Conversation
- DatasetConfig now exposes optional `robot_type` / `control_mode`
overrides applied to `meta.info` in `make_dataset`. None means "do
not override"; an explicit "" clears the loaded value.
- DatasetMixtureConfig adds `require_non_empty_{robot_type,control_mode}`
flags (default False) that raise in `make_dataset_mixture` when any
dataset still has an empty value after overrides.
- The control_mode override path also pre-suppresses the
"missing control_mode" warning for the affected repo_id, since the
user knew it was missing and is providing a value on purpose.
Refs #204
Contributor
|
[claude-review] summary for commit 27d500a
|
Member
Author
|
@claude fix per suggestion and nits if they make sense. |
- addresses @claude[bot] (length-mismatch dead branch): converted the silent early-return in `_validate_metadata_requirements` to an `assert` so a future refactor that breaks the 1:1 dataset_cfgs:datasets invariant can't quietly bypass `require_non_empty_*` checks. - addresses @claude[bot] (ordering invariant): added a one-line comment in `make_dataset` noting the warning-suppression must run before `LeRobotDataset(...)` to prevent a future hoist from breaking it. - addresses @claude[bot] (private cross-module symbol): replaced the `_CONTROL_MODE_WARNED` import with a new public `suppress_control_mode_warning(repo_id)` helper exported from `lerobot_dataset.py`; the set itself stays private. tests: passed — pytest -m "not gpu and not slow" tests/datasets/test_dataset_mixture.py tests/datasets/test_datasets.py tests/datasets/test_optional_keys.py Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WilliamYue37
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Refs #204.
Adds two related knobs for
robot_typeandcontrol_modemetadata:DatasetConfig.robot_typeandDatasetConfig.control_mode(bothstr | None, defaultNone= nooverride). When set, they are written through to
dataset.meta.infoafterthe dataset is constructed in
make_dataset. An explicit""is treated as"clear the loaded value" (distinct from
None).DatasetMixtureConfig.require_non_empty_robot_typeand
require_non_empty_control_mode(bothbool, defaultFalse).Defaults preserve today's behavior: empty values are tolerated. When opted
into,
make_dataset_mixtureraises with a per-dataset breakdown of whichfield is missing.
When a
control_modeoverride is provided, the "missing control_mode" warningin
LeRobotDataset.__init__is pre-suppressed for the affected repo_id —the user already knew it was missing and is providing a value on purpose.
How it was tested
TestRobotTypeControlModeOverridesAndRequirementsintests/datasets/test_dataset_mixture.py(15 tests):DatasetConfigdefaults / accepts overrides / accepts explicit"".DatasetMixtureConfigrequire flags defaultFalse._apply_metadata_overrides: writes through, no-op onNone,""clears,skips
dataset.control_modeattr update for VQA datasets that don't haveone.
_validate_metadata_requirements: no-op when flags off; passes whenpopulated; raises for empty /
None/ missing values; reportslabel+repo_id; aggregates multiple failures.pre-commit run --all-filesclean.pytest -m "not gpu and not slow" tests/datasets/test_dataset_mixture.py tests/datasets/test_datasets.py tests/datasets/test_optional_keys.pyall green.How to checkout & try? (for the reviewer)
Example config snippet that opts in to the strict checks:
{ "dataset_mixture": { "datasets": [ {"repo_id": "lerobot/droid_100", "robot_type": "panda", "control_mode": "joint"} ], "require_non_empty_robot_type": true, "require_non_empty_control_mode": true } }Checklist
Note: Before submitting this PR, please read the contributor guideline.
Generated by Claude Code