You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] Can not refer to field in a list of structs #32794
Traceback (most recent call last):
File "foo.py", line 31, in <module>
dataset.scanner(columns=["objects.attr2"]).to_table()
File "pyarrow/_dataset.pyx", line 298, in pyarrow._dataset.Dataset.scanner
File "pyarrow/_dataset.pyx", line 2356, in pyarrow._dataset.Scanner.from_dataset
File "pyarrow/_dataset.pyx", line 2202, in pyarrow._dataset._populate_builder
File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: No match for FieldRef.Name(objects.attr2) in objects: list<item: struct<attr1: double, attr2: int64, name: string>>
__fragment_index: int32
__batch_index: int32
__last_in_fragment: bool
__filename: string
Miles Granger / @milesgranger:
Should also mention, that if you are only after a single list element, you can do the following, albeit ugly, bit of code here. Until it's properly fixed.
Reopening. This was closed as a duplicate of #30143, but that issue covered selecting fields of a plain struct, which #14326 fixed. Selecting a field inside a list of structs, e.g. columns=['events.foo'] where events is list<struct<foo: string>>, still fails on pyarrow 26.0.1 with "No match for FieldRef.Nested".
Activity
asfimport commentedon Oct 19, 2022
Miles Granger / @milesgranger:
I think this is a duplicate of ARROW-14596 ? (That will also solve providing dotted path when
use_legacy_dataset=False)asfimport commentedon Oct 20, 2022
Miles Granger / @milesgranger:
Should also mention, that if you are only after a single list element, you can do the following, albeit ugly, bit of code here. Until it's properly fixed.
thisisnic commentedon Nov 7, 2026
Reopening. This was closed as a duplicate of #30143, but that issue covered selecting fields of a plain struct, which #14326 fixed. Selecting a field inside a list of structs, e.g.
columns=['events.foo']whereeventsislist<struct<foo: string>>, still fails on pyarrow 26.0.1 with "No match for FieldRef.Nested".