viirya commented on code in PR #50327:
URL: https://github.com/apache/arrow/pull/50327#discussion_r3630952037


##########
python/pyarrow/array.pxi:
##########
@@ -1864,7 +1864,21 @@ cdef class Array(_PandasConvertible):
         lst : list
         """
         self._assert_cpu()
-        return [x.as_py(maps_as_pydicts=maps_as_pydicts) for x in self]
+        cdef int64_t i, n = self.length()
+        if maps_as_pydicts is not None:
+            # Converting maps to dicts has per-entry semantics (duplicate-key
+            # detection); use the Scalar-based conversion for exact behavior.
+            return [x.as_py(maps_as_pydicts=maps_as_pydicts) for x in self]

Review Comment:
   Added a TODO in 1d80beb925. Note the stacked #50430 removes this limitation 
entirely — it threads `maps_as_pydicts` through `_getitem_py` so every type 
keeps its fast path when the flag is set.



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