[python] Add Paimon LeRobot map-style dataset - #9498
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
Two remaining issues after re-checking the updated head.
| "Paimon table is missing LeRobot fields: %s" | ||
| % sorted(missing)) | ||
|
|
||
| self._dataset, splits, read_table, snapshot_id = _lazy_torch_dataset( |
There was a problem hiding this comment.
[P2] Please reject unsupported lazy-reader fallbacks before loading payload columns. to_torch() silently calls _materialize() when the row-ID path is unavailable; a reachable example is query authorization masking _ROW_ID. In that case constructing this wrapper reads and retains the full projected table even though the documented contract says payload columns remain lazy, and enabling deltas materializes a second projection as well. This can turn dataset construction into O(table size) payload I/O and memory use on training-scale tables. Please preflight the lazy eligibility and fail with an actionable error, or provide a lazy routing path for these cases.
| def _resolve_metadata(metadata): | ||
| if isinstance(metadata, (str, Path)): | ||
| root = Path(metadata) | ||
| if root.name == "meta": |
There was a problem hiding this comment.
[P2] Please disambiguate the dataset root and meta/ directory structurally instead of using the basename. A valid dataset rooted at /datasets/meta stores its metadata at /datasets/meta/meta/info.json, but this branch rewrites the root to /datasets and then rejects it. Check <input>/meta/info.json first as the dataset-root form; only if that is absent should <input>/info.json be treated as the metadata-directory form and resolved to its parent.
|
I think the imported dataset should be self-contained in Paimon, but separate typed tables would be clearer than either duplicating metadata in every frame or storing all metadata in a generic A possible logical dataset bundle is:
All component tables should use the same With this contract, The current PR leaves the source of truth split between Paimon frames and an external metadata directory. I suggest defining and implementing the self-contained multi-table import contract first, then keeping |
|
To clarify the business meaning of the three proposed metadata tables, they represent three different levels of the dataset rather than merely splitting one metadata blob by file type. 1.
|
34b5fb7 to
49b85b7
Compare
49b85b7 to
f8dd204
Compare
Purpose
Add a map-style
PaimonLeRobotDatasetfor training from imported LeRobot v3 image datasets.Changes
version_id, or the latest published version, from<table>__versions.dataset.metaand restore task/subtask text from their native Pandas indices.__getitems__and multi-workerDataLoaderreads without materializing frame payloads.Scope
This first version supports image-backed LeRobot v3 datasets imported by
load_from_lerobot(). Video-backed reads remain a follow-up to #9494.Tests
53 passedinpypaimon/tests/torch_read_test.py.53 passedinpypaimon/tests/multimodal_lerobot_test.pywith LeRobot 0.4.4 and PyArrow 19.0.1.py_compile, andgit diff --checkpass.