File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -1483,14 +1483,8 @@ def to_numpy(
1483
1483
def map (self , mapper , na_action : Literal ["ignore" ] | None = None ):
1484
1484
if is_numeric_dtype (self .dtype ):
1485
1485
return map_array (self .to_numpy (), mapper , na_action = na_action )
1486
- if self .dtype .name .startswith ("timestamp" ):
1487
- try :
1488
- # Convert elements to pandas.Timestamp (or datetime64[ns])
1489
- self = self .astype ("datetime64[ns]" )
1490
- except Exception :
1491
- # fallback: safe, slow path
1492
- self = np .array ([Timestamp (x .as_py ()) for x in self ])
1493
- return map_array (self , mapper , na_action = na_action )
1486
+ elif self .dtype == "timestamp[ns][pyarrow]" :
1487
+ return map_array (self .to_numpy (dtype = object ), mapper , na_action = na_action )
1494
1488
else :
1495
1489
return super ().map (mapper , na_action )
1496
1490
You can’t perform that action at this time.
0 commit comments