Skip to content

Commit 78b92c4

Browse files
committed
call self.to_numpy() when self.dtype.pyarrow_dtype is datelike
1 parent c5457f6 commit 78b92c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,10 @@ def to_numpy(
14801480
def map(self, mapper, na_action: Literal["ignore"] | None = None):
14811481
if is_numeric_dtype(self.dtype):
14821482
return map_array(self.to_numpy(), mapper, na_action=na_action)
1483+
elif pa.types.is_date(self.dtype.pyarrow_dtype) or pa.types.is_timestamp(
1484+
self.dtype.pyarrow_dtype
1485+
):
1486+
return map_array(self.to_numpy(), mapper, na_action=na_action)
14831487
else:
14841488
return super().map(mapper, na_action)
14851489

0 commit comments

Comments
 (0)