-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
BUG fix deprecation of limit
and fill_method
in pct_change
#55527
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cc8d745
extra specific deprecation messages
Charlie-XIAO afbeac0
deprecation in docstring
Charlie-XIAO 7991ac6
Merge remote-tracking branch 'upstream/main' into redepr-pct-change
Charlie-XIAO 096bc78
use fill_method=None
Charlie-XIAO e7c6296
apply richard's suggestions
Charlie-XIAO 80e190f
Merge remote-tracking branch 'upstream/main' into redepr-pct-change
Charlie-XIAO 6e457ef
update tests correspondingly
Charlie-XIAO d874bb5
Merge remote-tracking branch 'upstream/main' into redepr-pct-change
Charlie-XIAO b18801e
changelog added; suggestions from Richard
Charlie-XIAO dc4bff1
Merge remote-tracking branch 'upstream/main' into redepr-pct-change
Charlie-XIAO 33f3053
updated changelog
Charlie-XIAO dd00755
Update v2.1.2.rst
rhshadrach File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think we need warning messages for every single case. Does something like
work?
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 we may want to prompt users to use
fill_method=None
even if they have filled NA values. See the original comment of this PR. The case is, even afterffill
orbfill
, callingpct_change
without keyword will raise deprecation warning unless we explicitly check if there are NA values to fill. However, I don't think this is a good approach: (1) this may add too much overhead, and (2) if a user is not filling NA values and usespct_change
without keyword, and if the data occasionally does not contain NA values, he/she will not get a warning message and the logic would be incorrect.Due to these reasons, I think this deprecation would be especially confusing, especially since we are having "incorrect" deprecation warnings in the current version. That's why I'm trying to give extra specific guide for each case. If maintainers do not think this is necessary, I can implement using only a single message.
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.
Still, I need a confirmation about whether we should prompt users to do
obj.ffill/bfill().pct_change(fill_method=None)
orobj.ffill/bfill().pct_change()
. Personally I prefer the former as I explained in the previous comment.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'm seeing the current logic takes 7.5% of the runtime for the current warning on a Series with 100k rows - I don't think overhead is a concern. This will cause users to modify their code unnecessarily in what I think is the uncommon case. They will then need to change their code again when we deprecate the
fill_method
argument. I do not think we should do that.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.
Sure, I will implement your suggestions.
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.
Perhaps "Either fill in any non-leading NA values" is better.
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.
agreed with @rhshadrach