-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: Fix mypy ignores in parsers #39342
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
can you merge master |
…p_parsers � Conflicts: � pandas/io/parsers/c_parser_wrapper.py � pandas/io/parsers/python_parser.py
Done @simonjayhawkins Is it ok to use the | syntax? |
quick comment on the |
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.
wow this looks good. cc @simonjayhawkins
pandas/io/parsers/base_parser.py
Outdated
# pandas\io\parsers.py:1559: error: Need type annotation for | ||
# 'counts' [var-annotated] | ||
counts = defaultdict(int) # type: ignore[var-annotated] | ||
counts: DefaultDict[int | str, int] = defaultdict(int) |
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 an mi, the dict key is a tuple?
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 are right, thx. I looked them through again and fixed 2 more I think
pandas/io/parsers/base_parser.py
Outdated
# pandas\io\parsers.py:1559: error: Need type annotation for | ||
# 'counts' [var-annotated] | ||
counts = defaultdict(int) # type: ignore[var-annotated] | ||
counts: DefaultDict[int | str, int] = defaultdict(int) |
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 an mi, the dict key is a tuple?
ping @simonjayhawkins |
pandas/io/parsers/base_parser.py
Outdated
self, col_indices: List[int], names: List[Union[int, str]] | ||
self, col_indices: List[int], names: List[int | str | tuple] |
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.
see #39538 for some discussion on this syntax change - perhaps it's best to defer it?
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.
Will roll this back then
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.
Rolled back
thanks @phofl |
Tried fixing the Mypy Errors in parsers