-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
ENH: Using pyright to analyze missing type declarations #39813
Comments
For type-checking tests, by adding the return type Also, adding |
which can only be an int. |
see also #40202 for a POC of a more explicit and comprehensive way of testing overloads |
@Dr-Irv IIUC we're doing this now. is this issue still active? |
I created this issue as a reference so that we could identify which parts of the pandas source are missing type declarations. So it is still valid, unless we feel that all of the pandas source now has type declarations (which I don't think is true). I did edit the description to refer to |
This describes a procedure for using the command line tool
pyright
(https://github.com/microsoft/pyright/blob/master/docs/command-line.md) to identify places in the pandas code that are missing type declarations. xref #28142py.typed
in the same folder aspandas\__init__.py
cd
to the folder containingREADME.md
from pandas, and typepyright --verifytypes pandas! > pyright.out
verifytypes.py
which can be run from the command line aspython verifytypes.py
and will print the top 20 modules that need fixing.Open issues for adding types:
pyright
to determine where thing are missing will not determine if we are missing appropriate overloads. See example below.tests
code, and adding# ignore
comments when we are specifically testing for incorrect types.verifytypes.py utility
Example using DataFrame.rename() where overloads are needed
This is taken from https://github.com/microsoft/python-type-stubs/blob/main/pandas/core/frame.pyi
The text was updated successfully, but these errors were encountered: