Skip to content

[python] Add LeRobot Dataset v3 import - #9446

Draft
XiaoHongbo-Hope wants to merge 5 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/lerobot-import
Draft

[python] Add LeRobot Dataset v3 import#9446
XiaoHongbo-Hope wants to merge 5 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/lerobot-import

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add a one-time PyPaimon importer:

LeRobot Dataset v3 -> Arrow batches -> Paimon table

This follows load_from_hdf5() and reuses the existing connection, table creation, strict append validation, BLOB, batch write, and snapshot commit paths. It does not add dynamic training conversion, Dataset Version, Ray, Torch DataLoader, or Paimon-to-LeRobot export.

Public API:

result = conn.load_from_lerobot(
    "robot_data",
    "/path/to/lerobot_dataset",
)
  • Local LeRobot v3 directories are supported first; FileIO directory URIs such as OSS use explicit source_options, and a non-path string may be a Hugging Face repo_id.
  • A missing table is created from meta/info.json; an existing table uses the same strict schema validation and append behavior as HDF5 import.
  • Each frame becomes one Paimon row. Batches never cross Episode boundaries, and one call produces one commit/snapshot.
  • Standard feature names and index fields are preserved; feature_mapping and transform are optional.

Feature mapping:

LeRobot feature Paimon/Arrow representation
Numeric or string scalar Corresponding scalar type
One-dimensional numeric tensor Fixed-length vector
Higher-rank numeric tensor Nested array with a fixed-length innermost vector
Image or video frame BLOB

Images retain their compressed source bytes. Video is decoded through the official LeRobot API and each frame is stored once as an independent PNG BLOB, so the complete MP4 is not copied into every row. URI metadata and Parquet files are read directly through Paimon FileIO. Because the LeRobot 0.4 video decoder requires a local path, only the active MP4 chunk for each video feature is cached temporarily and removed after import; credentials are never inherited from the target Catalog.

LeRobot remains optional through pypaimon[lerobot]. The first version supports LeRobot Dataset v3 and rejects v2.x, uint64, depth video, and unsupported language event structures with explicit errors.

Tests

  • Official LeRobot API creates a two-Episode v3 dataset entirely in a temporary directory, without network access.
  • Covers metadata-derived schema, scalar/vector/action/observation/timestamp values, Episode and frame order, task text, row count, snapshot, strict append validation, missing optional dependency, OSS options/isolation, and image/video BLOB round trips.
  • multimodal_lerobot_test.py: 9 passed
  • multimodal_hdf5_test.py: 24 passed
  • multimodal_table_test.py: 68 passed
  • ./paimon-python/dev/lint-python.sh -i license,flake8: passed
  • Python 3.6 syntax compilation for the shared modules: passed
  • git diff --check: passed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant