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

Add modules to check-untyped #8242

Merged
merged 8 commits into from
Sep 29, 2023
Merged

Add modules to check-untyped #8242

merged 8 commits into from
Sep 29, 2023

Conversation

max-sixty
Copy link
Collaborator

In reviewing #8241, I realize that we actually want check-untyped-defs, which is a bit less strict, but lets us add some more modules on. I did have to add a couple of ignores, think it's a reasonable tradeoff to add big modules like computation on.

Errors with this enabled are actual type errors, not just mypy pedanticness, so would be good to get as much as possible into this list...

max-sixty and others added 2 commits September 27, 2023 14:54
In reviewing pydata#8241, I realize that we actually want `check-untyped-defs`, which is a bit less strict, but lets us add some more modules on. I did have to add a couple of ignores, think it's a reasonable tradeoff to add big modules like `computation` on.

Errors with this enabled are actual type errors, not just `mypy` pedanticness, so would be good to get as much as possible into this list...
Copy link
Collaborator

@headtr1ck headtr1ck left a comment

Choose a reason for hiding this comment

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

Just a couple of minor remarks, some are more my personal opinion than actual rules...

pyproject.toml Show resolved Hide resolved
xarray/core/computation.py Outdated Show resolved Hide resolved
xarray/core/computation.py Outdated Show resolved Hide resolved
xarray/core/computation.py Outdated Show resolved Hide resolved
xarray/core/computation.py Outdated Show resolved Hide resolved
@@ -1478,7 +1478,7 @@ def __iter__(self) -> Iterator[Hashable]:
if TYPE_CHECKING:
# needed because __getattr__ is returning Any and otherwise
# this class counts as part of the SupportsArray Protocol
__array__ = None
__array__ = None # type: ignore[var-annotated,unused-ignore]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI I was getting this locally but not in CI — not sure why — but on balance seems reasonable to exclude. Possible a dependency issue; we can try removing some of these ignore[unused-ignore] in the future manually, given they definitionally elude our other checks...

@max-sixty
Copy link
Collaborator Author

@Illviljan is it OK if I merge? There may be small conflicts with #8241 — which seems unfair given you inspired these changes! Or merge #8241 and I'll resolve conflicts

(unless you disagree, I'll merge later today, hope that's OK...)

@headtr1ck headtr1ck added plan to merge Final call for comments topic-typing labels Sep 28, 2023
@Illviljan Illviljan merged commit a5f666b into pydata:main Sep 29, 2023
@Illviljan
Copy link
Contributor

Thanks @max-sixty !

@max-sixty max-sixty deleted the check-untyped branch September 29, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plan to merge Final call for comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants