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

pd.read_excel() has some parameters incorrectly documented #385

Closed
Dr-Irv opened this issue Sep 17, 2020 · 3 comments
Closed

pd.read_excel() has some parameters incorrectly documented #385

Dr-Irv opened this issue Sep 17, 2020 · 3 comments
Assignees
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

@Dr-Irv
Copy link

Dr-Irv commented Sep 17, 2020

Environment data

  • Language Server version: 2020.9.5
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.7.5

Code Snippet / Additional information

The stubs for read_excel have some errors with respect to the header and skiprows arguments. The following diffs in the file dist/bundled-stubs/pandas/io/excel/_base.pyi fix these issues:

diff _base.pyi.ORIG _base.pyi
10c10
<     header: Union[int, Sequence[int]] = ...,
---
>     header: Optional[Union[int, Sequence[int]]] = ...,
20c20
<     skiprows: Optional[Sequence[int]] = ...,
---
>     skiprows: Optional[Union[Sequence[int], int, Callable]] = ...,
271c271
<     header: Union[int, Sequence[int]] = ...,
---
>     header: Optional[Union[int, Sequence[int]]] = ...,
281c281
<     skiprows: Optional[Sequence[int]] = ...,
---
>     skiprows: Optional[Union[Sequence[int], int, Callable]] = ...,

Details on why these changes are needed:

  1. For header, the value None is allowed
  2. For skiprows, the docs need to be updated. See DOC: read_excel supports skiprows argument like read_csv, but tests and docs needed pandas-dev/pandas#36435
@jakebailey jakebailey added the bug Something isn't working label Sep 17, 2020
@github-actions github-actions bot removed the triage label Sep 17, 2020
@Dr-Irv
Copy link
Author

Dr-Irv commented Sep 17, 2020

Note - when I first reported this, I thought that sheetname was wrong, but now I see what the @overload is doing, so all is well. Updated the original text above to remove that part.

@gramster
Copy link
Member

For skiprows, this is motivation to start making PRs against pandas to inline these types or we'll be whacking moles endlessly.

@judej judej added typestub Issue relating to our bundled type stubs and removed bug Something isn't working labels Sep 21, 2020
@gramster gramster added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Sep 22, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.9.6, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202096-23-september-2020

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