[MAINTENANCE] Suppress mypy assignment errors in Trino compatibility module#11707
Merged
NathanFarmer merged 2 commits intodevelopfrom Mar 6, 2026
Merged
[MAINTENANCE] Suppress mypy assignment errors in Trino compatibility module#11707NathanFarmer merged 2 commits intodevelopfrom
NathanFarmer merged 2 commits intodevelopfrom
Conversation
✅ Deploy Preview for niobium-lead-7998 canceled.
|
joshua-stauffer
approved these changes
Mar 6, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11707 +/- ##
========================================
Coverage 84.57% 84.57%
========================================
Files 472 472
Lines 39202 39202
========================================
Hits 33157 33157
Misses 6045 6045 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
trinopackage added a PEP-561py.typedmarker in version 0.337.0 (released 2026-03-06). Before this, mypy treatedtrinoas an untyped package and silently ignored its type information. Now thattrinois recognized as typed, mypy type-checks both branches of thetry/except ImportErrorpattern incompatibility/trino.pyand flags assigningNotImportedto variables it infers asModuleType.This doesn't reproduce locally when
trinois installed because mypy considers theexceptbranch unreachable. In CI, wheretrinois not installed, mypy still infers module types from theimportstatements and checks both branches.What
Add
# type: ignore[assignment]with explanatory comments to each fallback assignment incompatibility/trino.py, matching the pattern already used inpostgresql.pyand other compatibility modules.