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

TYP: Update mypy and pyright #56493

Merged
merged 4 commits into from
Dec 19, 2023
Merged

Conversation

twoertwein
Copy link
Member

The first commit contains changes for only the mypy update.

The second commit contains only changes for pyright 1.1.399 (this commit has three remaining errors caused by a bug fixed in 1.1.400 ).

The third commit tries to get to 1.1.400. One major change in 1.1.400 is that pyright now also infers missing return annotations for partially annotated functions. Many of these functions would require complex overloads or ignore codes. I added a few overloads but for now, I would prefer to update to 1.1.399 (and ignore the error fixed in 1.1.400).

# note: assumes python env is setup and activated
name: pyright reportGeneralTypeIssues
entry: pyright --skipunannotated -p pyright_reportGeneralTypeIssues.json --level warning
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to pyright_reportGeneralTypeIssues.json.

max_value=pd.Timestamp(1900, 1, 1).to_pydatetime(),
min_value=pd.Timestamp(
1900, 1, 1
).to_pydatetime(), # pyright: ignore[reportGeneralTypeIssues]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could theoretically be NaTType

@@ -39,6 +41,7 @@
"pandas/core/arrays/string_arrow.py",
"pandas/core/arrays/timedeltas.py",
"pandas/core/computation/align.py",
"pandas/core/computation/ops.py",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be removed in 1.1.400

@twoertwein twoertwein marked this pull request as ready for review December 16, 2023 03:22
@mroeschke mroeschke added Code Style Code style, linting, code_checks Typing type annotations, mypy/pyright type checking labels Dec 18, 2023
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice looks like its mostly cleanups. Just a merge conflict

@mroeschke mroeschke added this to the 2.2 milestone Dec 19, 2023
@mroeschke mroeschke merged commit 6787245 into pandas-dev:main Dec 19, 2023
44 checks passed
@mroeschke
Copy link
Member

Thanks @twoertwein

@twoertwein twoertwein deleted the typing_deps branch December 19, 2023 19:11
cbpygit pushed a commit to cbpygit/pandas that referenced this pull request Jan 2, 2024
* changes for mypy

* changes for pyright

* 1.1.400 would require too many difficult changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants