Skip to content

Commit 311bb72

Browse files
committed
Removed flag 'inplace=True' from test and fixed the bug for this case.
1 parent 0a9a542 commit 311bb72

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pandas/core/internals/blocks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,8 @@ def where(self, other, cond) -> list[Block]:
16821682

16831683
try:
16841684
res_values = arr._where(cond, other).T
1685+
except OutOfBoundsDatetime:
1686+
raise
16851687
except (ValueError, TypeError):
16861688
if self.ndim == 1 or self.shape[0] == 1:
16871689
if isinstance(self.dtype, (IntervalDtype, StringDtype)):

pandas/tests/frame/methods/test_fillna.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,4 +794,4 @@ def test_fillna_out_of_bounds_datetime():
794794

795795
msg = "Cannot cast 0001-01-01 00:00:00 to unit='ns' without overflow"
796796
with pytest.raises(OutOfBoundsDatetime, match=msg):
797-
df.fillna(Timestamp("0001-01-01"), inplace=True)
797+
df.fillna(Timestamp("0001-01-01"))

0 commit comments

Comments
 (0)