From 9320144a66611e027ec95aa52383a7e22164654d Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 1 Oct 2023 22:23:06 +0100 Subject: [PATCH] BUG: interpolate raising wrong error for ea --- doc/source/whatsnew/v2.1.2.rst | 1 + pandas/core/arrays/base.py | 4 ++-- pandas/tests/frame/methods/test_interpolate.py | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/source/whatsnew/v2.1.2.rst b/doc/source/whatsnew/v2.1.2.rst index 1a25b848e0f84..87d95f0dee07f 100644 --- a/doc/source/whatsnew/v2.1.2.rst +++ b/doc/source/whatsnew/v2.1.2.rst @@ -22,6 +22,7 @@ Fixed regressions Bug fixes ~~~~~~~~~ +- Fixed bug in :meth:`DataFrame.interpolate` raising incorrect error message (:issue:`55347`) - Fixed bug in :meth:`DataFrame.resample` not respecting ``closed`` and ``label`` arguments for :class:`~pandas.tseries.offsets.BusinessDay` (:issue:`55282`) - Fixed bug in :meth:`DataFrame.resample` where bin edges were not correct for :class:`~pandas.tseries.offsets.BusinessDay` (:issue:`55281`) - diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index 933944dbd4632..001e0a5f4996e 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -891,8 +891,8 @@ def interpolate( limit, limit_direction, limit_area, - fill_value, - copy: bool, + fill_value=None, + copy: bool = True, **kwargs, ) -> Self: """ diff --git a/pandas/tests/frame/methods/test_interpolate.py b/pandas/tests/frame/methods/test_interpolate.py index 291a79815a81c..67aa07dd83764 100644 --- a/pandas/tests/frame/methods/test_interpolate.py +++ b/pandas/tests/frame/methods/test_interpolate.py @@ -497,3 +497,9 @@ def test_interpolate_empty_df(self): result = df.interpolate(inplace=True) assert result is None tm.assert_frame_equal(df, expected) + + def test_interpolate_ea_raise(self): + # GH#55347 + df = DataFrame({"a": [1, None, 2]}, dtype="Int64") + with pytest.raises(NotImplementedError, match="does not implement"): + df.interpolate()