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

Fix new mypy 1.12 errors #284

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Fix new mypy 1.12 errors #284

merged 1 commit into from
Oct 14, 2024

Conversation

alexfikl
Copy link
Collaborator

No description provided.

@@ -83,14 +83,15 @@ def is_array_field(f: Field) -> bool:
f"Field '{f.name}' union contains non-array container "
"arguments. All arguments must be array containers.")

if isinstance(f.type, str):
Copy link
Collaborator Author

@alexfikl alexfikl Oct 14, 2024

Choose a reason for hiding this comment

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

f.type is now correctly a Union[type[Any], str], which disagreed with is_array_type below. This just moves the check out of if __debug__ to let mypy know we handle that case.

Copy link
Owner

Choose a reason for hiding this comment

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

Sounds good. In the short-ish term, we'll probably need to handle this case better, too. Maybe just tossing it to parse might be enough? (though some of the identifiers may not resolve?) At any rate, a discussion for a different day.

@inducer inducer merged commit 6931a22 into inducer:main Oct 14, 2024
12 checks passed
@alexfikl alexfikl deleted the fix-mypy-1-12 branch October 15, 2024 05:37
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.

2 participants