Skip to content

Commit 38f375a

Browse files
committed
use self.dtype.kind to filter all datetimelike
1 parent a741e4b commit 38f375a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,16 +1490,9 @@ def to_numpy(
14901490
return result
14911491

14921492
def map(self, mapper, na_action: Literal["ignore"] | None = None):
1493-
if not is_string_dtype(self.dtype) and any(
1494-
[
1495-
is_numeric_dtype(self.dtype)
1496-
or pa.types.is_date(self.dtype.pyarrow_dtype)
1497-
or pa.types.is_timestamp(self.dtype.pyarrow_dtype)
1498-
]
1499-
):
1493+
if self.dtype.kind == "mM" or is_numeric_dtype(self.dtype):
15001494
return map_array(self.to_numpy(), mapper, na_action=na_action)
1501-
else:
1502-
return super().map(mapper, na_action)
1495+
return super().map(mapper, na_action)
15031496

15041497
@doc(ExtensionArray.duplicated)
15051498
def duplicated(

0 commit comments

Comments
 (0)