-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Stacklevel argument updated #46687 #47035
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
Can you suggest me some test to write for these? |
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 just an internal refactor, so as long as the current test-suite passes, no new tests should be necessary
pandas/util/_decorators.py
Outdated
stacklevel: int = 2, | ||
stacklevel: int = None, |
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.
if you're defining it below (L308), you don't need it as argument any more, do you?
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.
No, I will remove it. Also should I check other files for definition of stacklevel and change them?
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.
you should remove it from the docstring as well
currently failing with
|
Hey @MarcoGorelli I tried changing the files and ran conftest.py to check, but getting errors like |
hey @Anupam-USP - what command did you run that gave you that output? You might need to re-compile the C extensions ( |
To overcome the aforementioned issue, I have to still declare it as I did previously. |
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.
To overcome
E TypeError: deprecate_nonkeyword_arguments() got an unexpected keyword argument 'stacklevel'
you should remove calls of deprecate_nonkeyword_arguments
where stacklevel
is passed
To address the other issue, you probably just need to recompile the C extensions (python setup.py build_ext -j 4
). There should be no need to keep stacklevel
as an argument to deprecate_nonkeyword_arguments
pandas/util/_decorators.py
Outdated
@@ -304,6 +305,7 @@ def decorate(func): | |||
f"{future_version_msg(version)} all arguments of " | |||
f"{name or func.__qualname__}{{arguments}} will be keyword-only." | |||
) | |||
stacklevel = find_stack_level() |
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.
in L317, you should just set
stacklevel=find_stack_level()
rather than assigning it here
@Anupam-USP what's new entry not needed as this is not public (i removed it) |
couple of test failures, I'll take a look later
|
As noted here #47385 , I think the test failure might be a false-positive. Will try to address that one first |
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.
Thanks @Anupam-USP and @MarcoGorelli |
* Stacklevel argument updated pandas-dev#46687 * argument removed * param added * fixup * remove stackevel from read_sas decorator * add read_table_check_warnings and use it in read_table posargs deprecation test Co-authored-by: Jeff Reback <[email protected]> Co-authored-by: Marco Gorelli <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.