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

Fix Type Annotation in pandas.compat.pickle_compat #25988

Closed
vaibhavhrt opened this issue Apr 4, 2019 · 4 comments · Fixed by #25991
Closed

Fix Type Annotation in pandas.compat.pickle_compat #25988

vaibhavhrt opened this issue Apr 4, 2019 · 4 comments · Fixed by #25991
Milestone

Comments

@vaibhavhrt
Copy link
Contributor

Part of #25882

Current errors are as follows:

mypy pandas/compat/pickle_compat.py

pandas\compat\pickle_compat.py:141: error: Name 'pkl._Unpickler' is not defined
@vaibhavhrt
Copy link
Contributor Author

PR coming as soon as figure out how to fix this.

@vaibhavhrt
Copy link
Contributor Author

Looks like a bug with mypy because _Unpickleris certainly a class in module pickle.
Similar to python/mypy#6383
Only solution I can find is:

class Unpickler(pkl._Unpickler):  # type: ignore

@WillAyd what should I do?

@WillAyd
Copy link
Member

WillAyd commented Apr 4, 2019

I don't think it's a bug - the stdlib just doesn't have annotations for pickle yet and that private class is not exposed in Typeshed. I think ignore is the only option for now

@vaibhavhrt
Copy link
Contributor Author

Ok, I will open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants