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: Incorrect parameter type for pandas.Index.get_level_values() #780

Closed
DannyNemer opened this issue Dec 27, 2020 · 5 comments
Closed
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 27, 2020

Environment

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

Expected behavior

Recognize that the parameter level for pandas.Index.get_level_values(level) can be of type str or int.

Actual behavior

Pylance incorrectly reports that the parameter level for pandas.Index.get_level_values(level) must be a string:

Code Snippet

Should not return errors:

import pandas as pd

pd.Index(['ds']).get_level_values(0)

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 Dec 29, 2020
@github-actions github-actions bot removed the triage label Dec 29, 2020
@jakebailey
Copy link
Member

https://github.com/microsoft/python-type-stubs is the new canonical source for these stubs, for reference.

@DannyNemer
Copy link
Author

microsoft/python-type-stubs is the new canonical source for these stubs, for reference.

@jakebailey Thank you! Would it be more efficient for me to create these issues in that repo? Or, does that repo not receive the same degree of visibility? I'm happy to do whichever is easiest for you. 🙂

@jakebailey
Copy link
Member

That's a great question, because on one hand we want to close issues here so people know we shipped the stubs in Pylance, but on the other, it'd be nice for them to be in the repo they are fixed in... I don't know if we have a solid answer yet, that repo is very new (and then we all went on break for the holidays).

@jakebailey
Copy link
Member

No harm in having these here at the moment, transferring is easy.

@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Mar 13, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.3.2, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202132-17-march-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

3 participants