-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: Enforce deprecation of previous implementation of DataFrame.stack #57302
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
Conversation
that's unfortunate. |
@@ -28,6 +28,9 @@ def future_stack(request): | |||
|
|||
|
|||
class TestDataFrameReshape: | |||
@pytest.mark.filterwarnings( | |||
"ignore:The previous implementation of stack is deprecated" |
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.
Will there still be appetite to fix the future_stack=False
case in 3.x? If not I would be OK only testing future_stack=True
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 stated in #57152 (comment) that PRs to fix an issue with stack are welcome, but this made me rethink that. One potential consideration is that a bugfix can inadvertently introduce new issues. For this reason, I'm now thinking for a deprecated behavior we should prefer stability over bugfixes.
I'll remove the tests.
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 - I've come full circle on this. If you're okay with it, I'd rather leave the tests in for now in case something unanticipated occurs.
Also were you thinking of deprecating |
Currently if you use |
OK but in a follow up they will be deprecated then? I see from the 2.1 whatsnew
|
I don't think there is a need to deprecate them - they must remain unspecified and so removing them is backwards compatible. In other words, if you run pandas 2.x (or 3.x) without any warnings, then your code will be fine in 4.0. |
# Conflicts: # doc/source/whatsnew/v3.0.0.rst
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.
So in 4.0 we can just remove sort
and dropna
from the signature of stack
?
Just a merge conflict otherwise looks good
# Conflicts: # doc/source/whatsnew/v3.0.0.rst
Correct. |
Thanks @rhshadrach |
…ck (pandas-dev#57302) * DEPR: Enforce deprecation of previous implementation of DataFrame.stack * fixup * whatsnew
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Ref: #53515
We need to keep the
future_stack
argument in 3.0, but have two choices: still allow users to specifyfuture_stack=False
(while always seeing the warning message) or removefuture_stack=False
entirely now. In either case, we'd introduce a deprecation of thefuture_stack
argument (regardless of how it's being specified) as part of 3.x (I plan on 3.1).I went with the former option of still allowing
future_stack=False
- it seemed more gradual.