-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: make the type annotations of read_csv & read_table discoverable #34976
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
babb386
to
ef4b0d2
Compare
I am on board with this. This probably also closes #25648 |
So maybe worth pulling the test case from #33023 |
I'm a bit torn on this TBH I see the benefits to this change (mypy + #25648, #33023), but on the other hand, it does mean we will need to maintain two copies of essentially the same signature. This function generator setup was meant to alleviate that. If we're mostly okay with maintaining two copies of the signature, then go for it. @pandas-dev/pandas-core |
@topper-123 : Ah, that's a fair point. Okay...it still feels little hacky, but the test does make me feel better about this. |
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.
engine = "c" | ||
engine_specified = False | ||
|
||
kwds.update( |
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.
at some point, would be beneficial for consistency checking to not use the dictionary here as mypy doesn't check this.
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.
any comments @TomAugspurger or @jorisvandenbossche
No comments.
…On Thu, Jun 25, 2020 at 9:37 AM Jeff Reback ***@***.***> wrote:
***@***.**** approved this pull request.
any comments @TomAugspurger <https://github.com/TomAugspurger> or
@jorisvandenbossche <https://github.com/jorisvandenbossche>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34976 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKAOIVCUXXW5OVFSKHFMHTRYNOJDANCNFSM4OHB6EIQ>
.
|
Thanks @topper-123 |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
In master the type of
read_csv
andread_table
is 'Any'. This PR makes the functions signatures discoverable by mypy. Also fixes the error message when wrong kwarg is passed.