Skip to content

BUG: 🌃 mypy nightly - #1764

Merged
loicdiridollou merged 6 commits into
pandas-dev:mainfrom
cmp0xff:mypy-fix
Jun 12, 2026
Merged

loicdiridollou merged 6 commits into
pandas-dev:mainfrom
cmp0xff:mypy-fix

Conversation

@cmp0xff

@cmp0xff cmp0xff commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added (Please use assert_type() to assert the type of any return value)
  • If I used AI to develop this pull request, I prompted it to follow AGENTS.md.

@cmp0xff
cmp0xff marked this pull request as draft June 10, 2026 08:37
@cmp0xff

cmp0xff commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

/mypy_nightly

@cmp0xff

cmp0xff commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@Dr-Irv

Dr-Irv commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

I think the issue is here:

NumpyBooleanDtypeArg: TypeAlias = type[np.bool_] | Literal["?", "b1", "bool_"]

I think it should be:

NumpyBooleanDtypeArg: TypeAlias = type[np.bool_] | type[np.bool] | Literal["?", "b1", "bool_", "bool"]

I think mypy is now picking this up and it didn't before.

@cmp0xff

cmp0xff commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

/mypy_nightly

@cmp0xff

cmp0xff commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

/mypy_nightly

@cmp0xff
cmp0xff marked this pull request as ready for review June 12, 2026 15:54
@cmp0xff

cmp0xff commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Now mypy nightly errors are all suppressed.

@loicdiridollou loicdiridollou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great one @cmp0xff, thanks for the PR!

@loicdiridollou
loicdiridollou merged commit 6255df5 into pandas-dev:main Jun 12, 2026
15 checks passed
@cmp0xff
cmp0xff deleted the mypy-fix branch June 12, 2026 16:12
cmp0xff added a commit to cmp0xff/pandas-stubs that referenced this pull request Aug 28, 2026
* fix: python/mypy#21497

* fix: one more issue

* chore: black

* fix: attempt to fix mypy nightly

* fix: relax type[np.bool_] to type[np.bool], which means type[np.bool[Any]]

* fix: python/mypy#21608
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants