-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: Deprecating Function Arguments #17828
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
Comments
I disagree with not raising for the default value is how it is typically done. I think it is rather the other way around (we normally put the deprecated kwarg to a default of None, to be able to distinguish the default and an actual user passed value). This is also how the It might be that we just missed a few of those cases while reviewing in the PRs where you deprecated something, and so you have the impression that this is not the typical way deprecations are done (and likewise it is possible that I only reviewed mainly those PRs where we do it this way and thus I have the opposite impression) Of course this issue is only relevant for a certain part of the deprecations (eg it is not relevant for deprecating/renaming kwargs that have no default value, or for changing a default value, or for deprecating/renaming a full method/class).
It is true that it is making the signature less informative, but I think we need to have this warning, as it is the purpose of the warning that people can change their code before it breaks. |
deprecated kwargs should always be All of the examples by @jorisvandenbossche should be fixed. |
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
@jreback : Only the second one needs fixing. All others are according to what @jorisvandenbossche described above. |
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Indeed, the others were to show we generally do it like this. |
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes gh-17828.
The original one that sparked the discussion still needs to be done I think: |
Issue warnings on `read_csv` deprecated args in full, even if the normal defaults were passed in. Closes pandas-devgh-17828.
Issue warnings on `read_csv` deprecated args in full, even if the normal defaults were passed in. Closes pandas-devgh-17828.
Issue warnings on `read_csv` deprecated args in full, even if the normal defaults were passed in. Closes pandas-devgh-17828.
Issue warnings on `read_csv` deprecated args in full, even if the normal defaults were passed in. Closes gh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Issue warnings on `read_csv` deprecated args in full, even if the normal defaults were passed in. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Issue warnings on `read_csv` deprecated args in full, even if the normal defaults were passed in. Closes pandas-devgh-17828.
Previously, we weren't issuing a warning if the user happened to pass in the original default of "True", which would cause downstream code to break. Closes pandas-devgh-17828.
Issue warnings on `read_csv` deprecated args in full, even if the normal defaults were passed in. Closes pandas-devgh-17828.
When we want to deprecate and remove arguments, our general methodology has been to issue the deprecation warning ONLY when a non-default argument has been passed in.
However, @jorisvandenbossche pointed out in #17820 that this warnings framework does not take into account situations where the user EXPLICITLY passes in the default argument. Thus, we risk breaking downstream code in that case.
An alternative method would be to change the default argument (to some dummy) that we can use to catch this argument when passed in with the current accepted values.
While I have not seen this case emerge (patching is relatively painless, which might be why we haven't seen this issue on our tracker), I think it's worthwhile considering as we move forward with parameter deprecations + adjusting previous ones.
The text was updated successfully, but these errors were encountered: