Skip to content

Commit 044f0a1

Browse files
committed
isna
1 parent 76c9ba7 commit 044f0a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pandas/core/arrays/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,10 @@ def round(self, decimals: int = 0, *args, **kwargs) -> Self:
22652265
f"Cannot round {type(self)} dtype as it is non-numeric or boolean"
22662266
)
22672267
return self._from_sequence(
2268-
[round(element) if not isna(element) else element for element in self],
2268+
[
2269+
round(element) if not element_isna else element
2270+
for (element, element_isna) in zip(self, self.isna())
2271+
],
22692272
dtype=self.dtype,
22702273
)
22712274

pandas/tests/extension/test_datetime.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,11 @@ def check_reduce(self, ser: pd.Series, op_name: str, skipna: bool):
138138

139139
else:
140140
return super().check_reduce(ser, op_name, skipna)
141-
141+
142142
@pytest.mark.skip("DatetimeArray uses a different function signature for round")
143143
def test_round(self):
144144
pass
145145

146146

147-
148147
class Test2DCompat(base.NDArrayBacked2DTests):
149148
pass

0 commit comments

Comments
 (0)