-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN, TYP use from __future__ import annotations #39036
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
CLN, TYP use from __future__ import annotations #39036
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.
Thanks @MarcoGorelli lgtm pending green.
Not yet figured out how to write a good automated check for this
yep. last year there was alot of activity on manually migrating to f-strings, only for a tool to come along that would have did it for us.
see also #36091 |
@MarcoGorelli I'll merge this now as without a check it's a waste of valuable reviewer time to check that all quotes are removed from a module when the import is added. but there we a few here that are obvious without a through check. |
@@ -322,7 +324,7 @@ def should_reindex_frame_op( | |||
|
|||
|
|||
def frame_arith_method_with_reindex( | |||
left: "DataFrame", right: "DataFrame", op | |||
left: DataFrame, right: DataFrame, op | |||
) -> "DataFrame": |
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.
here
@@ -139,7 +141,7 @@ def melt( | |||
|
|||
|
|||
@deprecate_kwarg(old_arg_name="label", new_arg_name=None) | |||
def lreshape(data: "DataFrame", groups, dropna: bool = True, label=None) -> "DataFrame": | |||
def lreshape(data: DataFrame, groups, dropna: bool = True, label=None) -> "DataFrame": |
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.
here
@@ -234,7 +236,7 @@ def lreshape(data: "DataFrame", groups, dropna: bool = True, label=None) -> "Dat | |||
|
|||
|
|||
def wide_to_long( | |||
df: "DataFrame", stubnames, i, j, sep: str = "", suffix: str = r"\d+" | |||
df: DataFrame, stubnames, i, j, sep: str = "", suffix: str = r"\d+" |
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.
here
a separate PR dealing with return types is welcome. |
Seeing as pandas is Python3.7+ we can clean up some annotations. Not yet figured out how to write a good automated check for this, but here's a start