-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Deprecate passing default args as positional in DataFrame.set_index #41495
Deprecate passing default args as positional in DataFrame.set_index #41495
Conversation
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.
LGTM
pandas/core/frame.py
Outdated
@@ -5301,6 +5302,7 @@ def shift( | |||
periods=periods, freq=freq, axis=axis, fill_value=fill_value | |||
) | |||
|
|||
@deprecate_nonkeyword_arguments(version="2.0", allowed_args=["self", "keys"]) |
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.
do we set the version in other deprecations? I don't think we generally want to, for example what if we delayed this to 3.0 then we'd have to update all of these messages.
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 in general it is useful information to mention the version when it is going to be removed)
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.
what our deprecation policy does say
Deprecations will only be enforced in major releases. For example, if a behavior is deprecated in pandas 1.2.0, it will continue to work, with a warning, for all releases in the 1.x series. The behavior will change and the deprecation removed in the next major release (2.0.0).
out deprecation policy also says
pandas will introduce deprecations in minor releases.
what our deprecation policy does NOT say is what happens when the deprecation is introduced late in the series and there are no further releases in the series.
so if our next release after 1.3 (where these deprecations are introduced) is 2.0, do we deprecate the behaviour? "Deprecations will only be enforced in major releases." so the next major release is 3.0.
if the next release is 1.4, then OK to deprecate in 2.0?
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 would've thought it would be OK to deprecate in 2.0 regardless of whether there's a 1.4 release
If the deprecation is introduced in 1.3.0 (minor release) and then enforced in 2.0 (the next major release), then isn't that inline with the policy?
I don't understand how you got to "so the next major release is 3.0"
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.
this is yet another reason we don't want to actually use the version string in the message
in any event we can choose or not to release 1.4 (no depreciations removed ) or just do 2.0 (where all depreciations are removed)
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 recall a comment from Joris that we should not expect all users to upgrade to every version and that users could skip versions.
so if we introduce in one version, should we enforce in the next?
# https://github.com/pandas-dev/pandas/issues/41485 | ||
df = DataFrame({"a": [1, 2, 3]}) | ||
msg = ( | ||
r"Starting with Pandas version 2\.0 all arguments of set_index except for " |
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.
and the comment on the other PRs about the message.
423b79c
to
f4da184
Compare
inplace
#41485