You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/17 08:25:19 UTC

[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #13652: ARROW-17131: [Python] add StructType().field(): returns a field by name or index

jorisvandenbossche commented on code in PR #13652:
URL: https://github.com/apache/arrow/pull/13652#discussion_r947600813


##########
python/pyarrow/tests/test_types.py:
##########
@@ -633,7 +643,7 @@ def test_struct_duplicate_field_names():
 def test_union_type():
     def check_fields(ty, fields):
         assert ty.num_fields == len(fields)
-        assert [ty[i] for i in range(ty.num_fields)] == fields
+        assert [ty.field(i) for i in range(ty.num_fields)] == fields

Review Comment:
   Small last comment: can you keep both those lines? (we should still test that the `[]` version works as well)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org