AlenkaF commented on a change in pull request #11765:
URL: https://github.com/apache/arrow/pull/11765#discussion_r756746256



##########
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:
       Should I add `StructFieldOptions` in `test_option_class_equality()` also?
   
https://github.com/apache/arrow/blob/bec0a6beac3415e03400088a3269f3be3fc7150c/python/pyarrow/tests/test_compute.py#L119-L120




-- 
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