kszucs commented on a change in pull request #8361:
URL: https://github.com/apache/arrow/pull/8361#discussion_r500499506



##########
File path: python/pyarrow/tests/test_pandas.py
##########
@@ -2297,6 +2310,24 @@ def test_from_tuples(self):
             df, expected=expected_df, schema=expected_schema,
             expected_schema=expected_schema)
 
+    def test_struct_of_dictionary(self):
+        names = ['ints', 'strs']
+        children = [pa.array([456, 789, 456]).dictionary_encode(),
+                    pa.array(["foo", "foo", None]).dictionary_encode()]
+        arr = pa.StructArray.from_arrays(children, names=names)
+
+        # Expected a Series of {field name: field value} dicts
+        rows_as_tuples = zip(*(child.to_pylist() for child in children))
+        rows_as_dicts = [dict(zip(names, row)) for row in rows_as_tuples]

Review comment:
       Expanded the nested comprehension to make it a bit more readable.




----------------------------------------------------------------
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:
[email protected]


Reply via email to