JingsongLi commented on code in PR #11059:
URL: https://github.com/apache/paimon/pull/11059#discussion_r4519863570


##########
paimon-python/pypaimon/multimodal/lerobot/loader.py:
##########
@@ -332,6 +332,8 @@ def _validate_frame_controls(
                    sorted(allowed_tasks)))
         seen_tasks.add(task_index)
         if subtask_indices is not None:
+            if values["subtask_index"][offset] is None:

Review Comment:
   **[P2] Handle an empty subtask vocabulary before committing frames**
   
   When every frame has `subtask_index = NULL` and `meta/subtasks.parquet` is a 
typed zero-row table, this check lets the frames through. The importer then 
commits the frame snapshot before metadata publication raises `LeRobot import 
requires a non-empty subtasks component.` The failed import leaves the target 
table behind, so retrying with the same name fails. I reproduced this with a 
local Paimon catalog. Could we support publishing and tagging an empty 
vocabulary and add an end-to-end test for this case?



##########
paimon-python/pypaimon/multimodal/lerobot/dataset.py:
##########
@@ -1483,8 +1493,9 @@ def _attach_task_labels(rows, task_names, subtask_names):
         task_index = operator.index(row["task_index"])
         row["task"] = task_names[task_index]
         if subtask_names is not None:
-            subtask_index = operator.index(row["subtask_index"])
-            row["subtask"] = subtask_names[subtask_index]
+            subtask_index = row["subtask_index"]
+            row["subtask"] = (None if subtask_index is None

Review Comment:
   **[P2] Return `subtask=None` when the vocabulary is empty**
   
   A custom `PaimonDatasetReader` can supply `subtasks=[]` and a frame with 
`subtask_index=None`. `_index_names` turns that empty vocabulary into `None`, 
so both the sample and the batch omit the `subtask` key. Code that accesses the 
documented field then gets a `KeyError`. Could we preserve an explicitly empty 
vocabulary as `{}` so null indices still produce `subtask=None` and non-null 
indices are checked against the vocabulary?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to