-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: non-keyword arguments in any #44896
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
Changes from 8 commits
59bd617
389cb03
076efc0
7f643d6
d6df993
d2653da
0f15b62
831481c
284efd3
e002897
912b040
b229a3b
0c3ebd7
799e12b
3441523
cdb96f7
49a1b0b
76003ed
787616d
0375347
5573d34
a13ee6f
6e5b3ac
63ae9c1
1010e1e
424b213
8007cf1
a361637
ea19d40
2678298
96de045
86ad6ba
7dec331
b4b3a1f
11917aa
35c71b6
0e6d5eb
025c493
59ac830
d9d14e9
15bbc86
a8dd741
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10365,7 +10365,7 @@ def any( | |
skipna: bool_t = True, | ||
level: Level | None = None, | ||
**kwargs, | ||
) -> Series | bool_t: | ||
): | ||
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. Can you keep the return type here? Also, as this is only used internally, we can make its arguments keyword-only right away without warning 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. By making arguments keyword-only, do you mean placing arguments after |
||
return self._logical_func( | ||
"any", nanops.nanany, axis, bool_only, skipna, level, **kwargs | ||
) | ||
|
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.
Based on python/mypy#11759 (comment) it is possible to just have the type annotations without the actual implementation.
(Hope it doesn't break the doc generation.)
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.
Nice, does this work (using
...
)? I thought somethling likeany : Callable[...] # or Probably a protocol
but that will then not allow you to change the doc-stringThere 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.
Not sure actually - @yadav-sachin shall we just remove any modifications to
frame.py
andseries.py
in this PR, to keep it focused (and to get it through)? Apologies for contradicting requests from my partThere 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.
When checking with mypy, I was not getting any errors with this method (using
...
)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 problem, have removed the changes from the two mentioned files.
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 meant more whether this works in practice. I would expect that any() wouldn't do anything when called on Series/DataFrame (unless
...
magically delegates to NDFrame - would be cool if it does).