File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1481,10 +1481,20 @@ def to_numpy(
1481
1481
return result
1482
1482
1483
1483
def map (self , mapper , na_action : Literal ["ignore" ] | None = None ):
1484
- if is_numeric_dtype (self .dtype ) or self .dtype .kind in "mM" :
1484
+ from pandas import Series
1485
+
1486
+ pa_type = self ._pa_array .type
1487
+
1488
+ if pa .types .is_timestamp (pa_type ) or pa .types .is_duration (pa_type ):
1489
+ datelike = self ._maybe_convert_datelike_array ()
1490
+ temp = Series (datelike , dtype = datelike .dtype )
1491
+ mapped = temp .map (mapper , na_action = na_action )
1492
+ return mapped ._values
1493
+
1494
+ if is_numeric_dtype (self .dtype ):
1485
1495
return map_array (self .to_numpy (), mapper , na_action = na_action )
1486
- else :
1487
- return super ().map (mapper , na_action )
1496
+
1497
+ return super ().map (mapper , na_action = na_action )
1488
1498
1489
1499
@doc (ExtensionArray .duplicated )
1490
1500
def duplicated (
You can’t perform that action at this time.
0 commit comments