From d9053555f5f5d1ca86704db28650c9bfa1a0cf4c Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli Date: Fri, 23 Jun 2023 16:45:57 +0100 Subject: [PATCH] CLN: PDEP6 precusor (#53815) set dtype explicitly --- pandas/tests/copy_view/test_interp_fillna.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/tests/copy_view/test_interp_fillna.py b/pandas/tests/copy_view/test_interp_fillna.py index 71023a538a2c3..5d4fd75df830c 100644 --- a/pandas/tests/copy_view/test_interp_fillna.py +++ b/pandas/tests/copy_view/test_interp_fillna.py @@ -248,7 +248,10 @@ def test_fillna_inplace_reference(using_copy_on_write): def test_fillna_interval_inplace_reference(using_copy_on_write): - ser = Series(interval_range(start=0, end=5), name="a") + # Set dtype explicitly to avoid implicit cast when setting nan + ser = Series( + interval_range(start=0, end=5), name="a", dtype="interval[float64, right]" + ) ser.iloc[1] = np.nan ser_orig = ser.copy()