-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
CLN: enforce deprecation of the kind
keyword on df.resample/ser.resample
#58125
CLN: enforce deprecation of the kind
keyword on df.resample/ser.resample
#58125
Conversation
I enforced deprecation of the |
@@ -449,9 +449,7 @@ def test_resample_frame_basic_kind(freq, unit): | |||
index=date_range("2000-01-01", periods=10, freq="B"), | |||
) | |||
df.index = df.index.as_unit(unit) | |||
msg = "The 'kind' keyword in DataFrame.resample is deprecated" | |||
with tm.assert_produces_warning(FutureWarning, match=msg): | |||
df.resample(freq, kind="period").mean() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you can remove this test entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, done
@@ -8976,7 +8955,6 @@ def resample( | |||
freq=rule, | |||
label=label, | |||
closed=closed, | |||
kind=kind, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont see a diff in pandas.core.resample; doesn't the keyword need to be removed there too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, my mistake. I removed the keyword kind
from get_resampler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all/most of the kind
keywords in resample.py
be removable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. Yes, it was my mistake; kind
can be removed from Resampler
and TimeGrouper
. I have updated this PR. Could you please take a look?
@ChadFulton any objection to moving forward with this part of the deprecation? |
Thanks @jbrockmendel, this change makes a lot of sense to me! |
@@ -489,16 +479,17 @@ def test_cant_fill_missing_dups(self): | |||
s.resample("Y").ffill() | |||
|
|||
@pytest.mark.parametrize("freq", ["5min"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you inline this parameter since it's the only one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment otherwise LGTM
Thanks @natmokval |
…ample (pandas-dev#58125) * enforced deprecation of the kind keyword on df.resample/ser.resample * fix tests * fix tests * fix tests * add a note to v3.0.0 * return a blank line in resample.py back * remove leftover * remove kind from get_resampler, delete test * remove kwd kind from _get_resampler, fix test * remove kwd kind from the class Resampler * remove kind from TimeGrouper * inline the parameter freq in test_resample_5minute
xref #55895
enforced deprecation of the kind keyword on df.resample/ser.resample