Skip to content

[MAINTENANCE] Suppress mypy assignment errors in Trino compatibility module#11707

Merged
NathanFarmer merged 2 commits intodevelopfrom
fix-trino-type-errors
Mar 6, 2026
Merged

[MAINTENANCE] Suppress mypy assignment errors in Trino compatibility module#11707
NathanFarmer merged 2 commits intodevelopfrom
fix-trino-type-errors

Conversation

@NathanFarmer
Copy link
Contributor

@NathanFarmer NathanFarmer commented Mar 6, 2026

Why

The trino package added a PEP-561 py.typed marker in version 0.337.0 (released 2026-03-06). Before this, mypy treated trino as an untyped package and silently ignored its type information. Now that trino is recognized as typed, mypy type-checks both branches of the try/except ImportError pattern in compatibility/trino.py and flags assigning NotImported to variables it infers as ModuleType.

This doesn't reproduce locally when trino is installed because mypy considers the except branch unreachable. In CI, where trino is not installed, mypy still infers module types from the import statements and checks both branches.

What

Add # type: ignore[assignment] with explanatory comments to each fallback assignment in compatibility/trino.py, matching the pattern already used in postgresql.py and other compatibility modules.

@NathanFarmer NathanFarmer self-assigned this Mar 6, 2026
@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit b773860
🔍 Latest deploy log https://app.netlify.com/projects/niobium-lead-7998/deploys/69aafbd04a87920008ad2eb7

@NathanFarmer NathanFarmer changed the title [MAINTENANCE] Fix Trino type errors fix: suppress mypy assignment errors in trino compatibility module Mar 6, 2026
@NathanFarmer NathanFarmer changed the title fix: suppress mypy assignment errors in trino compatibility module [MAINTENANCE] suppress mypy assignment errors in trino compatibility module Mar 6, 2026
@NathanFarmer NathanFarmer changed the title [MAINTENANCE] suppress mypy assignment errors in trino compatibility module [MAINTENANCE] Suppress mypy assignment errors in Trino compatibility module Mar 6, 2026
@NathanFarmer NathanFarmer enabled auto-merge March 6, 2026 16:09
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.57%. Comparing base (8eb7627) to head (b773860).
⚠️ Report is 1 commits behind head on develop.
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
3.10 73.46% <100.00%> (-0.02%) ⬇️
3.10 athena ?
3.10 aws_deps ?
3.10 big ?
3.10 clickhouse ?
3.10 filesystem ?
3.10 mysql ?
3.10 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.10 postgresql ?
3.10 spark ?
3.10 spark_connect ?
3.10 sql_server ?
3.10 trino ?
3.11 73.51% <100.00%> (-0.02%) ⬇️
3.11 athena ?
3.11 aws_deps ?
3.11 big ?
3.11 clickhouse ?
3.11 filesystem ?
3.11 mysql ?
3.11 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.11 postgresql ?
3.11 spark_connect ?
3.11 sql_server ?
3.11 trino ?
3.12 73.53% <100.00%> (ø)
3.12 athena ?
3.12 aws_deps ?
3.12 big ?
3.12 filesystem ?
3.12 mysql ?
3.12 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.12 postgresql ?
3.12 spark ?
3.12 spark_connect ?
3.12 sql_server ?
3.12 trino ?
3.13 73.53% <100.00%> (ø)
3.13 athena 41.96% <100.00%> (ø)
3.13 aws_deps 45.22% <100.00%> (ø)
3.13 big 55.28% <100.00%> (ø)
3.13 bigquery 51.24% <100.00%> (ø)
3.13 clickhouse 41.98% <100.00%> (ø)
3.13 databricks 53.03% <100.00%> (ø)
3.13 filesystem 64.37% <100.00%> (ø)
3.13 gx-redshift 51.39% <100.00%> (ø)
3.13 mysql 51.79% <100.00%> (ø)
3.13 openpyxl or pyarrow or project or sqlite or aws_creds 59.95% <100.00%> (ø)
3.13 postgresql 55.16% <100.00%> (ø)
3.13 snowflake 53.87% <100.00%> (-0.01%) ⬇️
3.13 spark 55.91% <100.00%> (ø)
3.13 spark_connect 46.88% <100.00%> (ø)
3.13 sql_server 53.21% <100.00%> (ø)
3.13 trino 48.75% <0.00%> (ø)
cloud 0.00% <0.00%> (ø)
docs-basic 59.23% <0.00%> (ø)
docs-creds-needed 57.94% <100.00%> (ø)
docs-spark 57.31% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NathanFarmer NathanFarmer added this pull request to the merge queue Mar 6, 2026
Merged via the queue into develop with commit 6135113 Mar 6, 2026
61 checks passed
@NathanFarmer NathanFarmer deleted the fix-trino-type-errors branch March 6, 2026 17:44
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