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(
14811481 return result
14821482
14831483 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 ):
14851495 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 )
14881498
14891499 @doc (ExtensionArray .duplicated )
14901500 def duplicated (
You can’t perform that action at this time.
0 commit comments