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 IntrospectionQuery type definition #234

Merged
merged 3 commits into from
Feb 17, 2025
Merged

Conversation

sobolevn
Copy link
Contributor

TypedDict mangles private names as regular Python classes do. So, __schema name will become _IntrospectionQuery__schema instead. But, inline definition will preserve a correct name for the field. See python/cpython#129567

Found during python/mypy#16715

`TypedDict` mangles private names as regular Python classes do. So, `__schema` name will become `_IntrospectionQuery__schema` instead.
See python/cpython#129567

Found during python/mypy#16715
@sobolevn sobolevn requested a review from Cito as a code owner February 16, 2025 21:49
@Cito
Copy link
Member

Cito commented Feb 17, 2025

Thanks for reporting and the PR. Is this also a problem with current mypy versions? If yes, how can I provoke a typing error there?

@sobolevn
Copy link
Contributor Author

Not until python/mypy#16715 is merged

Copy link

codspeed-hq bot commented Feb 17, 2025

CodSpeed Performance Report

Merging #234 will not alter performance

Comparing sobolevn:patch-1 (e5d09fa) with main (44334f3)

Summary

✅ 14 untouched benchmarks

@Cito
Copy link
Member

Cito commented Feb 17, 2025

Looks good, but you need to silence the linter with # noqa: UP013 because it prefers class syntax, and add a small comment as explanation why we deviate from the class syntax here.

@Cito
Copy link
Member

Cito commented Feb 17, 2025

Now there are only mypy issues, probably because mypy has been updated and not related to this PR. Will fix them separately.

@Cito Cito merged commit dae8e8f into graphql-python:main Feb 17, 2025
11 of 12 checks passed
@Cito Cito removed their request for review February 17, 2025 20:01
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