jo-migo commented on code in PR #47454:
URL: https://github.com/apache/arrow/pull/47454#discussion_r2336839624


##########
python/pyarrow/scalar.pxi:
##########
@@ -1173,7 +1173,8 @@ cdef class MapScalar(ListScalar, Mapping):
         if not maps_as_pydicts:
             return list(self)
         result_dict = {}
-        for key, value in self:
+        for k, v in zip(self.values.field(self.type.key_field.name), 
self.values.field(self.type.item_field.name)):
+            key = k.as_py()

Review Comment:
   Thanks for the suggestion! I had indeed missed the existence of the `keys` 
method for simplifying this. Unfortunately I don't see any similar thing for 
directly iterating over the value fields inside the inner array, so I think 
that can't be simplified the same way.



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