google / grain

Apache License 2.0
288 stars 20 forks source link

Improve packing error message for non-meta nested fields. #571

Closed copybara-service[bot] closed 1 month ago

copybara-service[bot] commented 1 month ago

Improve packing error message for non-meta nested fields.

Previously, trying to pack data with a nested feature that isn't marked as a meta feature would result in AttributeError: 'dict' object has no attribute 'astype'. Now it will give a more useful error message along the lines of Failed to extract segment ids for 'nested_feature', which has type <class 'dict'> rather than np.ndarray. Perhaps it should be marked as a meta feature?.