HyukjinKwon commented on code in PR #14547:
URL: https://github.com/apache/arrow/pull/14547#discussion_r1089871427


##########
python/pyarrow/tests/test_array.py:
##########
@@ -991,6 +991,16 @@ def test_map_labelled():
     assert len(arr) == 2
 
 
+def test_map_from_dict():
+    # ARROW-17832
+    tup_arr = pa.array([[('a', 1), ('b', 2)], [('c', 3)]],
+                       pa.map_(pa.string(), pa.int64()))
+    dict_arr = pa.array([{'a': 1, 'b': 2}, {'c': 3}],

Review Comment:
   Thanks for this fix. Just had a quick followup question though. Should the 
nested dict work too? e.g.)
   
   ```python
   import pyarrow as pa
   pa.array([[{'a': 1, 'b': 2}, {'c': 3}]], pa.list_(pa.map_(pa.string(), 
pa.int64())))
   ```
   
   It currently fails w/
   
   ```
   pyarrow.lib.ArrowTypeError: Could not convert {'a': 1, 'b': 2} with type 
dict: was not a sequence or recognized null for conversion to list type
   ```
   



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