Skip to content

Eight LeRobot importer metadata refusals have no test, including the pagination loop guards #405

Description

@Sagar-024

Current behavior

The importer's episodes path carries a wall of refusals whose job is to fail loud on broken Hugging Face metadata. The suite covers the fps refusals (test_info_json_refuses_non_finite_or_non_positive_fps), the commit-sha refusal, the UTF-8 and JSON-decode errors (#301), and the boolean-dimension refusals (#306). Eight branches have no test at all. The receipt is a grep, the same one #393 used:

grep -rn "<message fragment>" tests/   ->  0 hits for all eight:

"not a LeRobot v3 repository"                  lerobot.py:462
"is not a JSON object"                         lerobot.py:472
"must define a non-empty data_path template"   lerobot.py:550
"must define a non-empty video_path template"  lerobot.py:555
"no meta/episodes parquet files found"         lerobot.py:572
"is not a list of objects"                     lerobot.py:416
"repeated an already fetched pagination URL"   lerobot.py:388
"contains an invalid pagination URL"           lerobot.py:395

(The two existing "is not a JSON object" hits are the runtime client's, not the importer's.)

The sharpest two:

Every branch is reachable with the same stub pattern the #301 tests already use (stub urlopen, feed fixed bytes), so none of this needs new machinery.

What the tests should assert

  1. Each refusal message, pinned byte-identical (they are user-facing).
  2. The pagination-guard tests prove termination: a response whose Link header repeats the fetched URL raises instead of hanging.
  3. No partial state: the refusals fire before any cache or output writes, matching the fail-loud contract of the covered refusals.

Definition of done

  1. All eight branches reached through the public import path with the LeRobot Hugging Face responses lose their source on JSON decode failures #301 stub pattern.
  2. Refusal messages pinned byte-identical; a regression changing any of them fails.
  3. The pagination and invalid-URL guards proven to terminate and to reject, respectively.
  4. No message text changes; no behavior changes.

Non-goals

  • Adding new refusals
  • Refactoring the fetch loop
  • Changing any refusal message

Validation

uv run ruff check --fix
uv run ruff format
uv run ty check
uv run pytest -q tests/test_lerobot_converter.py
uv run pytest -q

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions