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 2021/06/24 09:03:26 UTC

[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #10591: ARROW-13158: [Python] Fix StructScalar contains and repr with duplicate field names

jorisvandenbossche commented on a change in pull request #10591:
URL: https://github.com/apache/arrow/pull/10591#discussion_r657765844



##########
File path: python/pyarrow/tests/test_scalars.py
##########
@@ -514,7 +515,7 @@ def test_struct():
         s['non-existent']
 
     s = pa.scalar(None, type=ty)
-    assert list(s) == []
+    assert list(s) == list(s.keys()) == ['x', 'y']

Review comment:
       This is a change in behaviour, but it seems more correct to me, since you can still do `s['x']` (which gives you a null scalar). But on the other hand it conflicts with `s.as_py()` being `None` (and not `{'x': None, 'y': None}`)




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

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