From 670ef190c4a66c0c9dab21962720143369f98359 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 26 Oct 2025 18:36:34 +0000 Subject: [PATCH] Remove downcast argument from resample.interpolate --- pandas/core/resample.py | 8 -------- pandas/tests/copy_view/test_interp_fillna.py | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pandas/core/resample.py b/pandas/core/resample.py index 3a4ce952ffdcf..eb5f963598b02 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -850,7 +850,6 @@ def interpolate( inplace: bool = False, limit_direction: Literal["forward", "backward", "both"] = "forward", limit_area=None, - downcast=lib.no_default, **kwargs, ): """ @@ -907,11 +906,6 @@ def interpolate( (interpolate). * 'outside': Only fill NaNs outside valid values (extrapolate). - downcast : optional, 'infer' or None, defaults to None - Downcast dtypes if possible. - - .. deprecated:: 2.1.0 - **kwargs : optional Keyword arguments to pass on to the interpolating function. @@ -993,7 +987,6 @@ def interpolate( Note that the series correctly decreases between two anchors ``07:00:00`` and ``07:00:02``. """ - assert downcast is lib.no_default # just checking coverage result = self._upsample("asfreq") # If the original data has timestamps which are not aligned with the @@ -1030,7 +1023,6 @@ def interpolate( inplace=inplace, limit_direction=limit_direction, limit_area=limit_area, - downcast=downcast, **kwargs, ) diff --git a/pandas/tests/copy_view/test_interp_fillna.py b/pandas/tests/copy_view/test_interp_fillna.py index 6bcda0ef2c35a..9aed5d3a8d320 100644 --- a/pandas/tests/copy_view/test_interp_fillna.py +++ b/pandas/tests/copy_view/test_interp_fillna.py @@ -134,7 +134,7 @@ def test_interpolate_object_convert_copies(): arr_a = get_array(df, "a") msg = "Can not interpolate with method=pad" with pytest.raises(ValueError, match=msg): - df.interpolate(method="pad", inplace=True, downcast="infer") + df.interpolate(method="pad", inplace=True) assert df._mgr._has_no_reference(0) assert np.shares_memory(arr_a, get_array(df, "a")) @@ -148,7 +148,7 @@ def test_interpolate_downcast_reference_triggers_copy(): msg = "Can not interpolate with method=pad" with pytest.raises(ValueError, match=msg): - df.interpolate(method="pad", inplace=True, downcast="infer") + df.interpolate(method="pad", inplace=True) assert df._mgr._has_no_reference(0) assert not np.shares_memory(arr_a, get_array(df, "a"))