Skip to content
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

feat!: Removes inplace option for `pandas.core.resample.Resampler.i… #58847

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cbpygit
Copy link
Contributor

@cbpygit cbpygit commented May 27, 2024

…nterpolate`. Fixes / cleans up related test cases.

…nterpolate`. Fixes / cleans up related test cases.
…. Adds breaking API change description to whatsnew.
@cbpygit
Copy link
Contributor Author

cbpygit commented May 27, 2024

@MarcoGorelli somehow it did not auto-assign the reviewers. But in any case, here we are :)

@Aloqeely
Copy link
Member

Do these need to be deprecated first? You can use the deprecate_kwarg decorator for that

@cbpygit
Copy link
Contributor Author

cbpygit commented May 30, 2024

Do these need to be deprecated first? You can use the deprecate_kwarg decorator for that

I don't know what the exact policy is. But as far as I understand the deprecation tells the user that a certain future change will change the API. This does not apply here, as the inplace-functionality is already broken. We would need to add the deprecation to pandas 2 to inform users about the upcoming change, and to ease migration. But I guess this would need a separate PR that targets the next 2.x release.

@MarcoGorelli
Copy link
Member

Do these need to be deprecated first?

Thanks @Aloqeely - in general, yes, this would require a deprecation. However, here, the change is going to breaking anyway (in order to fix a historic feature bug), so to be honest I'd be OK removing inplace without warning too

@mroeschke mroeschke added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate inplace Relating to inplace parameter or equivalent Resample resample method labels May 31, 2024
@cbpygit cbpygit requested a review from mroeschke June 5, 2024 16:31
@cbpygit
Copy link
Contributor Author

cbpygit commented Jun 18, 2024

@mroeschke can we merge this? 😄

@@ -146,7 +146,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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that a lot of interpolate usages are still modified in the PR. Only tests that used to call.resample(...).interpolate(interpolate=) should have been changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inplace Relating to inplace parameter or equivalent Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Resample resample method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: In main, using resample().interpolate(inplace=True) raises an exception
4 participants