pitrou commented on code in PR #50327:
URL: https://github.com/apache/arrow/pull/50327#discussion_r3629254266
##########
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:
It's a pity that we're taking the slow path even if no maps are involved.
Perhaps add a comment or TODO about this?
--
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]