Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor to combine in one if block
  • Loading branch information
KevsterAmp committed Jun 13, 2025
commit ffb2a6f358fcb94d1922367756502947e4dab685
8 changes: 4 additions & 4 deletions pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1478,10 +1478,10 @@ def to_numpy(
return result

def map(self, mapper, na_action: Literal["ignore"] | None = None):
if is_numeric_dtype(self.dtype):
return map_array(self.to_numpy(), mapper, na_action=na_action)
elif pa.types.is_date(self.dtype.pyarrow_dtype) or pa.types.is_timestamp(
self.dtype.pyarrow_dtype
if (
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:
Expand Down
Loading