-
-
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
642957e
Stacklevel argument updated #46687
Anupam-USP 43cd385
argument removed
Anupam-USP 30d97f0
param added
Anupam-USP 2b59e2b
Merge branch 'main' into deprecate_stacklevel
jreback 8ed722a
Merge remote-tracking branch 'upstream/main' into pr/Anupam-USP-depre…
MarcoGorelli f491c65
fixup
MarcoGorelli 3213c78
Merge branch 'main' into deprecate_stacklevel
MarcoGorelli 3f78fed
Merge branch 'main' into deprecate_stacklevel
MarcoGorelli 995f2e0
Merge branch 'main' into deprecate_stacklevel
MarcoGorelli 4468340
remove stackevel from read_sas decorator
MarcoGorelli 8467639
add read_table_check_warnings and use it in read_table posargs deprec…
MarcoGorelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
|
||
from pandas._libs.properties import cache_readonly # noqa:F401 | ||
from pandas._typing import F | ||
from pandas.util._exceptions import find_stack_level | ||
|
||
|
||
def deprecate( | ||
|
@@ -260,7 +261,7 @@ def future_version_msg(version: str | None) -> str: | |
def deprecate_nonkeyword_arguments( | ||
version: str | None, | ||
allowed_args: list[str] | None = None, | ||
stacklevel: int = 2, | ||
stacklevel: int = None, | ||
name: str | None = None, | ||
) -> Callable[[F], F]: | ||
""" | ||
|
@@ -280,7 +281,7 @@ def deprecate_nonkeyword_arguments( | |
defaults to list of all arguments not having the | ||
default value. | ||
|
||
stacklevel : int, default=2 | ||
stacklevel : int | ||
The stack level for warnings.warn | ||
|
||
name : str, optional | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. in L317, you should just set
rather than assigning it here |
||
|
||
@wraps(func) | ||
def wrapper(*args, **kwargs): | ||
|
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.
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