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

pandas: Does not recognize module pandas.testing #769

Closed
DannyNemer opened this issue Dec 23, 2020 · 3 comments
Closed

pandas: Does not recognize module pandas.testing #769

DannyNemer opened this issue Dec 23, 2020 · 3 comments
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs

Comments

@DannyNemer
Copy link

DannyNemer commented Dec 23, 2020

Environment

  • Language Server: v2020.12.2
  • OS: macOS v10.15.6
  • Python: v3.7.9
  • Pandas: v1.1.5 (latest)

Expected behavior

Recognize the module pandas.testing.

Actual behavior

Pylance does not recognize pandas.testing:

Code Snippet

import pandas as pd

pd.testing.assert_frame_equal(pd.DataFrame(), pd.DataFrame())

Please let me know how I can improve this bug report because many more will follow (all for typeshed issues). Is this the best repo for such bug reports? (I am following the precedent of Pandas type issues in the release notes.)

@judej judej added the typestub Issue relating to our bundled type stubs label Jan 4, 2021
@github-actions github-actions bot removed the triage label Jan 4, 2021
@jakebailey
Copy link
Member

I think there's some question as to whether or not this is considered a part of the pandas API in this manner, as opposed to importing pandas.testing directly; IIRC this module is exposed via a side effect of Python imports done in the pandas __init__.py. If so, the fix will be to add it as an exported variable in our pandas stubs.

@gramster
Copy link
Member

gramster commented Mar 5, 2021

As far as I can tell the functions in testing are not documented and so I would probably not export them in the stubs. Our stub file is named _testing.pyi though so even importing testing will not add them; perhaps we should make some adjustment for that? I don't know how widely used these are.

@gramster gramster closed this as completed May 4, 2021
@jakebailey jakebailey reopened this May 4, 2021
@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label May 4, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.5.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202150-5-may-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs
Projects
None yet
Development

No branches or pull requests

4 participants