Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,13 @@ def to_numpy(
return result

def map(self, mapper, na_action: Literal["ignore"] | None = None):
if is_numeric_dtype(self.dtype):
if not is_string_dtype(self.dtype) and any(
[
is_numeric_dtype(self.dtype)
or pa.types.is_date(self.dtype.pyarrow_dtype)
or pa.types.is_timestamp(self.dtype.pyarrow_dtype)
]
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any idea why the super().map method isn't working correctly? If fixing things there is viable, that would be a better outcome

return map_array(self.to_numpy(), mapper, na_action=na_action)
else:
return super().map(mapper, na_action)
Expand Down
Loading