Skip to content

TYP: Fix chainmap typing for mypy 0.740+ #30680

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 2 commits into from
Jan 5, 2020

Conversation

xhochy
Copy link
Contributor

@xhochy xhochy commented Jan 4, 2020

This will otherwise raise a failure during a mypy update. Also increase type precision of this file to 100%.

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

cc @simonjayhawkins

@xhochy xhochy changed the title Fix chainmap typing for mypy 0.740+ TYP: Fix chainmap typing for mypy 0.740+ Jan 4, 2020
@alimcmaster1 alimcmaster1 added the Typing type annotations, mypy/pyright type checking label Jan 4, 2020
@jreback jreback added this to the 1.0 milestone Jan 4, 2020
@jreback
Copy link
Contributor

jreback commented Jan 4, 2020

cc @simonjayhawkins

@jreback
Copy link
Contributor

jreback commented Jan 4, 2020

note we are currently pinned to 0.73 for a number of issues.

@xhochy
Copy link
Contributor Author

xhochy commented Jan 4, 2020

note we are currently pinned to 0.73 for a number of issues.

Yes, I'm aware of them and this a tiny step to get rid of them.

@jreback
Copy link
Contributor

jreback commented Jan 4, 2020

note we are currently pinned to 0.73 for a number of issues.

Yes, I'm aware of them and this a tiny step to get rid of them.

great that's what I figured, thanks!

@topper-123
Copy link
Contributor

PR looks good to me.

There has been a build-in collections.ChainMap since python 3.3. Is this version different or could we switch over to the builtin version?

@xhochy
Copy link
Contributor Author

xhochy commented Jan 4, 2020

PR looks good to me.

There has been a build-in collections.ChainMap since python 3.3. Is this version different or could we switch over to the builtin version?

The typing one used here is simply a typed alias for it that exists since Python 3.6.

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

@xhochy lgtm. Thanks for the PR.

@simonjayhawkins
Copy link
Member

note we are currently pinned to 0.73 for a number of issues.

This will help for 0.73 too...

#30539 pandas\compat\chainmap.py:4: error: Implicit generic "Any". Use "typing.ChainMap" and specify generic parameters

@jreback jreback merged commit 51ce777 into pandas-dev:master Jan 5, 2020
@jreback
Copy link
Contributor

jreback commented Jan 5, 2020

thanks @xhochy

@xhochy xhochy deleted the typ-chainmap branch January 6, 2020 08:02
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.

5 participants