jorisvandenbossche commented on code in PR #14495:
URL: https://github.com/apache/arrow/pull/14495#discussion_r1016805953
##########
python/pyarrow/_compute.pyx:
##########
@@ -1322,7 +1322,39 @@ class MakeStructOptions(_MakeStructOptions):
cdef class _StructFieldOptions(FunctionOptions):
def _set_options(self, indices):
- self.wrapped.reset(new CStructFieldOptions(indices))
+ cdef:
+ CFieldRef field_ref
+ const CFieldRef* field_ref_ptr
+
+ # List[str]/List[bytes] converted to '.a.dotted.path'
+ if isinstance(indices, list) and len(indices):
+ if isinstance(indices[0], str):
+ indices = '.' + '.'.join(indices)
+ elif isinstance(indices[0], bytes):
+ indices = b'.' + b'.'.join(indices)
Review Comment:
Thanks! Can you also add a test for the changed `pc.field(..)` behaviour
itself? (without using the struct_field kernel)
--
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]