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 annotations for pandas.core.indexes.base #26363

Closed
vaibhavhrt opened this issue May 13, 2019 · 7 comments · Fixed by #26371
Closed

Fix type annotations for pandas.core.indexes.base #26363

vaibhavhrt opened this issue May 13, 2019 · 7 comments · Fixed by #26371

Comments

@vaibhavhrt
Copy link
Contributor

Part of #25882

Current errors are:

pandas\core\indexes\base.py:9: error: Module 'pandas._libs' has no attribute 'join'
@vaibhavhrt
Copy link
Contributor Author

The line with the error is:

from pandas._libs import (
    algos as libalgos, index as libindex, join as libjoin, lib)

A join.pyx file does exists in the _libs directory but mypy is still giving error. The other imports algos, index and lib are also .pyx file but there is no error for them.
@WillAyd some help here please. Do we need a .pyi file?

@WillAyd
Copy link
Member

WillAyd commented May 13, 2019

You can just move the join as alias to a separate line - Mypy doesn’t seem to like that all being on one line and we’ve done that elsewhere

@vaibhavhrt
Copy link
Contributor Author

@WillAyd you mean like this? 👇

from pandas._libs import (
    algos as libalgos, index as libindex, lib)
from pandas._libs import join as libjoin

@vaibhavhrt
Copy link
Contributor Author

No matter how I import it makes no difference. Still same error.

@WillAyd
Copy link
Member

WillAyd commented May 13, 2019 via email

@gwrome
Copy link
Contributor

gwrome commented May 13, 2019

Try import pandas._libs.join as libjoin.

@vaibhavhrt
Copy link
Contributor Author

@gwrome thanks, it works.

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