jorisvandenbossche commented on a change in pull request #11765:
URL: https://github.com/apache/arrow/pull/11765#discussion_r756691797
##########
File path: python/pyarrow/tests/test_compute.py
##########
@@ -2208,6 +2208,21 @@ def test_make_struct():
pc.make_struct(field_names=['one', 'two'])
+def test_struct_fields_options():
+ a = pa.array([4, 5, 6], type=pa.int64())
+ b = pa.array(["bar", None, ""])
+ c = pa.StructArray.from_arrays([a, b], ["a", "b"])
+ arr = pa.StructArray.from_arrays([a, c], ["a", "c"])
+
+ assert pc.struct_field(arr,
+ indices=[1, 1]) == pa.array(["bar", None, ""])
+ assert pc.struct_field(arr,
+ indices=[0]) == pa.array([4, 5, 6], type=pa.int64())
+ assert pc.struct_field(arr, indices=[]) == arr
+
+ # errors pc.struct_field(arr)
Review comment:
Can you maybe add a `TODO:
https://issues.apache.org/jira/browse/ARROW-14853 to all default options`?
(then I don't think this PR necessarily needs to wait until ARROW-14853 is
fixed
--
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]