Skip to content

Commit d3dc930

Browse files
remove interpolate changes
1 parent 638cb77 commit d3dc930

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,9 +2160,7 @@ def interpolate(
21602160
"""
21612161
# NB: we return type(self) even if copy=False
21622162
if not self.dtype._is_numeric:
2163-
raise NotImplementedError(
2164-
f"interpolate is not implemented for dtype={self.dtype}"
2165-
)
2163+
raise ValueError("Values must be numeric.")
21662164

21672165
if (
21682166
not pa_version_under13p0

pandas/tests/extension/test_arrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3451,7 +3451,7 @@ def test_string_to_datetime_parsing_cast():
34513451
)
34523452
def test_interpolate_not_numeric(data):
34533453
if not data.dtype._is_numeric:
3454-
with pytest.raises(NotImplementedError, match="interpolate is not implemented"):
3454+
with pytest.raises(ValueError, match="Values must be numeric."):
34553455
pd.Series(data).interpolate()
34563456

34573457

pandas/tests/frame/methods/test_interpolate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def test_interpolate_inplace(self, frame_or_series, request):
6464
assert np.shares_memory(orig, obj.values)
6565
assert orig.squeeze()[1] == 1.5
6666

67+
# TODO(infer_string) raise proper TypeError in case of string dtype
6768
@pytest.mark.xfail(
6869
using_string_dtype(), reason="interpolate doesn't work for string"
6970
)

0 commit comments

Comments
 (0)