Skip to content

CLN: fix mypy warnings/errors #29327

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

Merged
merged 5 commits into from
Nov 2, 2019
Merged

CLN: fix mypy warnings/errors #29327

merged 5 commits into from
Nov 2, 2019

Conversation

jbrockmendel
Copy link
Member

When I run mypy pandas locally I get a handful of complaints. This fixes about half of them. The other half are about FixedOffset which IIRC we are handling elsewhere.

cc @simonjayhawkins

@WillAyd
Copy link
Member

WillAyd commented Nov 1, 2019

What version of mypy are you using and what are the errors exactly? I'm very hesitant to add # type: ignore anywhere, especially if there's no urgency to do so

@angelaambroz fixed the issue with FixedOffset upstream in TypeShed and I think that will make its way into mypy 0.75

@WillAyd WillAyd added the Typing type annotations, mypy/pyright type checking label Nov 1, 2019
@jbrockmendel
Copy link
Member Author

0.740

@@ -68,7 +67,7 @@ def difference(self, other):
return type(self)(temp)

# TODO: Consider deprecating these in favor of `union` (xref gh-15506)
__add__ = __iadd__ = union
__add__ = __iadd__ = union # type: ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error now is essentially because union is unannotated, plus maybe a few more issues with subclass. In any case we should annotate instead of ignoring, especially since there's no rush on this one (current mypy in CI is still only 0.72)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, ill see if annotating union does the trick

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it worked for union, but not for _disabled. removed the "type: ignore"s

@pep8speaks
Copy link

pep8speaks commented Nov 2, 2019

Hello @jbrockmendel! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-11-02 02:37:11 UTC

@jreback jreback added this to the 1.0 milestone Nov 2, 2019
@jreback jreback merged commit 75c5db7 into pandas-dev:master Nov 2, 2019
@jreback
Copy link
Contributor

jreback commented Nov 2, 2019

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the mp branch November 2, 2019 15:11
Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants