-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
TYP: improve typing for DataFrame.to_string #44426
Conversation
pandas/core/frame.py
Outdated
self, | ||
buf: None = None, | ||
columns: Sequence[str] | None = None, | ||
col_space: int | None = 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.
Not directly related to your pr, but this type hint is wrong, can also be list[int] or dict
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.
Ok, I can look into that. Would like to get current version to pass first, then I’ll do this.
cc @simonjayhawkins @twoertwein if comments |
pandas/core/frame.py
Outdated
@overload | ||
def to_string( | ||
self, | ||
buf: None = 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.
can leave out the defaults for the overloads. It's only the parameter types that are relevant in overloads.
buf: None = None, | |
buf: 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.
@topper-123 there was a parameter moved in #44331
need changes here to the overloads to prevent mypy errors on merge master.
pandas/core/frame.py:1094: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc]
pandas/core/frame.py:1094: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
4aa2b8c
to
0debdb6
Compare
Updated. |
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 @topper-123 LGTM
Ping… |
Thanks @topper-123 |
This is going to fail ci checks... looking now. |
FilePathOrBuffer was changed in #43951 |
No description provided.