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

Module has no attribute "interchange" #712

Closed
MarcoGorelli opened this issue May 26, 2023 · 1 comment · Fixed by #713
Closed

Module has no attribute "interchange" #712

MarcoGorelli opened this issue May 26, 2023 · 1 comment · Fixed by #713
Labels
API - Consistency Internal Consistency of API/Behavior good first issue

Comments

@MarcoGorelli
Copy link
Member

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

  1. Provide a minimal runnable pandas example that is not properly checked by the stubs.
  2. Indicate which type checker you are using (mypy or pyright).
  3. Show the error message received from that type checker while checking your example.
(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ cat t.py
import pandas as pd

df = pd.DataFrame({'a': [1, 2, 3]})

res = pd.api.interchange.from_dataframe(df)
print(res)

(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ mypy t.py
t.py:5: error: Module has no attribute "interchange"  [attr-defined]
Found 1 error in 1 file (checked 1 source file)
(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ pip freeze | grep pandas
pandas==2.0.1
pandas-stubs==2.0.1.230501
(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ pip freeze | grep mypy
mypy==1.3.0
mypy-extensions==1.0.0

Please complete the following information:

  • OS: [e.g. Windows, Linux, MacOS] linux
  • OS Version [e.g. 22]
  • python version 3.10.6
  • version of type checker mypy
  • version of installed pandas-stubs 2.0.1.230501

Additional context
Add any other context about the problem here.

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented May 26, 2023

Need to add

    interchange as interchange,

to pandas-stubs/api/__init__.pyi

PR with tests welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants