Skip to content
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

TYPING: add stubs for _packer and _unpacker #28135

Merged
merged 2 commits into from
Aug 26, 2019

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Aug 25, 2019

xref #28133

pandas\io\packers.py:800: error: Base type _Packer becomes "Any" due to an unfollowed import
pandas\io\packers.py:820: error: Base type _Unpacker becomes "Any" due to an unfollowed import

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Aug 25, 2019
@WillAyd
Copy link
Member

WillAyd commented Aug 25, 2019

Are there packaging considerations to be made here? Given these modules are deprecated I think we should just ignore them if causing problems

@simonjayhawkins
Copy link
Member Author

pd.to_msgpack and pd.read_msgpack will not be deprecated until pandas 1.2. #27103

we will still be accepting bugfixes? if so, type hints should be a benefit. no reason to ignore?

@jreback
Copy link
Contributor

jreback commented Aug 25, 2019

we haven’t really quite decided on the length of this deprecation
but adding types would be fine

@WillAyd
Copy link
Member

WillAyd commented Aug 25, 2019

Sounds good. Would we need to do anything with setup.py to get these distributed?

@simonjayhawkins
Copy link
Member Author

atm we're primarily concerned with code quality? (and reducing the pull request review overhead if mypy can find problems)

making pandas PEP 561 compatible is outside the scope of the PR. https://mypy.readthedocs.io/en/latest/installed_packages.html#making-pep-561-compatible-packages

@WillAyd
Copy link
Member

WillAyd commented Aug 25, 2019

Cool that's what I was asking about. Yea doesn't need to be solved here but seems like already some people have started using types hints with IDEs, so would be good to ship stubs alongside releases. If you want to open an issue for that discussion would be helpful

@WillAyd WillAyd added this to the 1.0 milestone Aug 25, 2019
@simonjayhawkins
Copy link
Member Author

personally, my time spent in an IDE is with pandas itself and use notebook for using pandas. so i'll raise the issue but add contributions welcome so that someone using pandas as a library in an IDE can perhaps take it on.

@WillAyd WillAyd merged commit 7528d08 into pandas-dev:master Aug 26, 2019
@WillAyd
Copy link
Member

WillAyd commented Aug 26, 2019

Thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the packer-stubs branch August 27, 2019 09:29
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.

3 participants