-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Deprecate non-keyword arguments for Resampler.interpolate #41699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
638255f
fc93316
c526864
99ffd77
9f1363f
4990a15
afa41d0
b99fa40
3d8eff7
f6076d2
b47ecc2
c27e606
2954950
3497b5a
7ff25da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
datetime, | ||
timedelta, | ||
) | ||
from io import StringIO | ||
|
||
import numpy as np | ||
import pytest | ||
|
@@ -278,3 +279,36 @@ def test_resample_base_with_timedeltaindex(): | |
|
||
tm.assert_index_equal(without_base.index, exp_without_base) | ||
tm.assert_index_equal(with_base.index, exp_with_base) | ||
|
||
|
||
def test_interpolate_posargs_deprecation(): | ||
|
||
data = StringIO( | ||
"""\ | ||
Values | ||
1992-08-27 07:46:48,1 | ||
1992-08-27 07:46:59,4""" | ||
) | ||
s = pd.read_csv(data, squeeze=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you construct this directly? something like data = DataFrame({'ds': ['1992-08-27 07:46:48, '1992-08-27 07:46:59'], 'y': [1, 4]}) |
||
s.index = pd.to_datetime(s.index) | ||
|
||
msg = ( | ||
r"In a future version of pandas all arguments of DataFrame\.interpolate " | ||
r"except for the argument 'method' will be keyword-only" | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this test pass? The message doesn't seem right, and I"d expect it to be different for the Series case Have you run
locally? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is giving me following error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, so that needs fixing first :) I suggest you remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done that, got new issues due to |
||
|
||
with tm.assert_produces_warning(FutureWarning, match=msg): | ||
result = s.resample("3s").interpolate("linear") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to construct |
||
|
||
data_exp = StringIO( | ||
"""\ | ||
Values | ||
1992-08-27 07:46:48,1.0 | ||
1992-08-27 07:46:51,1.0 | ||
1992-08-27 07:46:54,1.0 | ||
1992-08-27 07:46:57,1.0""" | ||
) | ||
|
||
expected = pd.read_csv(data_exp, squeeze=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likewise, construct this directly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, will do it in some time! |
||
expected.index = pd.to_datetime(expected.index) | ||
tm.assert_frame_equal(result, expected) |
Uh oh!
There was an error while loading. Please reload this page.