You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many functions have no return annotations. Missing return annotations of public functions can easily be identified by running pyright (in an active python environment)
Many of these cases are easy to annotate (return annotations inferred by pyright are usually correct). When the suggested return annotation includes Any, Unknown, or a Union (|), it is usually more difficult to find a suitable type annotation.
The most difficult part is probably setting the python environment up and installing pyright. After adding new type annotations, delete the folder typings/pandas and run mypy&pyright: pre-commit run --hook-stage manual --all-files (or mypy ; pyright ; pyright --skipunannotated -p pyright_reportGeneralTypeIssues.json)
Many functions have no return annotations. Missing return annotations of public functions can easily be identified by running pyright (in an active python environment)
pyright --createstub pandas grep -R "# -> " typings/pandas/
Many of these cases are easy to annotate (return annotations inferred by pyright are usually correct). When the suggested return annotation includes Any, Unknown, or a Union (|), it is usually more difficult to find a suitable type annotation.
The most difficult part is probably setting the python environment up and installing pyright. After adding new type annotations, delete the folder typings/pandas and run mypy&pyright:
pre-commit run --hook-stage manual --all-files
(ormypy ; pyright ; pyright --skipunannotated -p pyright_reportGeneralTypeIssues.json
)Note: functions that pyright deems public are not necessarily public https://pandas.pydata.org/docs/reference/index.html
Number of missing return annotations per file
The text was updated successfully, but these errors were encountered: