Skip to content

Commit ffb2a6f

Browse files
committed
refactor to combine in one if block
1 parent 78b92c4 commit ffb2a6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,10 +1478,10 @@ def to_numpy(
14781478
return result
14791479

14801480
def map(self, mapper, na_action: Literal["ignore"] | None = None):
1481-
if is_numeric_dtype(self.dtype):
1482-
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
1481+
if (
1482+
is_numeric_dtype(self.dtype)
1483+
or pa.types.is_date(self.dtype.pyarrow_dtype)
1484+
or pa.types.is_timestamp(self.dtype.pyarrow_dtype)
14851485
):
14861486
return map_array(self.to_numpy(), mapper, na_action=na_action)
14871487
else:

0 commit comments

Comments
 (0)