Skip to content

fix(typing): restore full-tree mypy for semantic-layer kit and guest RLS test - #45835

Merged
sadpandajoe merged 1 commit into
masterfrom
ultraset-mypy-semantic-testing-virtual-dataset-test-errors
Oct 29, 2026
Merged

sadpandajoe merged 1 commit into
masterfrom
ultraset-mypy-semantic-testing-virtual-dataset-test-errors

Conversation

@sadpandajoe

Copy link
Copy Markdown
Member

SUMMARY

The nightly pre-commit checks run (prek run --all-files) fails mypy (main) with three errors. Per-PR runs only type-check changed files, and superset_core.* modules that are not on the command line are skipped (follow_imports = "skip") and become Any, so each error only surfaces in the full-tree run.

Changes, typing only, no runtime behavior change:

  • testing.py: [*query.dimensions, *query.metrics] joins to list[object]; build the expected name set from each list instead.
  • conformance_provider.py: ORDER BY members may be AdhocExpression, which the existing "not in columns" guard already rejects; add an isinstance filter so mypy can see it.
  • virtual_dataset_connections_test.py: annotate the guest rules dict so a rule carrying a dataset id is assignable.

TESTING INSTRUCTIONS

  1. With mypy 1.15.0 and the hook's types-* dependencies, run the full tree as the nightly job does: pre-commit run mypy --all-files (or prek run mypy --all-files).
  2. On master this reports 3 errors in 3 files; on this branch it reports Success: no issues found.
  3. Optionally run pytest superset-core/tests/semantic_layers/ and pytest tests/unit_tests/connectors/sqla/virtual_dataset_connections_test.py to confirm no behavior change.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Notes:

  • The isinstance filter in conformance_provider.py relies on the existing guard just above it; style-only observation from review, no behavior impact.

🤖 Generated with Claude Code

…RLS test

The nightly all-files mypy run fails with three errors that the per-PR
changed-file runs could not see, because superset_core modules that are
not on the command line are skipped (follow_imports = "skip") and typed
as Any:

- testing.py: [*query.dimensions, *query.metrics] joins to list[object];
  build the expected name set from each list instead.
- conformance_provider.py: ORDER BY members can be AdhocExpression,
  which the "not in columns" guard already rejects at runtime; narrow it
  for mypy with an isinstance filter.
- virtual_dataset_connections_test.py: annotate the guest rules dict so
  rules that carry a dataset id are assignable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sadpandajoe sadpandajoe added the ai:fix-master generated by AI to fix master branch label Oct 29, 2026
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: f91f7806b410

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.68%. Comparing base (2d2e557) to head (f91f780).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #45835   +/-   ##
=======================================
  Coverage   84.68%   84.68%           
=======================================
  Files        3069     3069           
  Lines      205465   205465           
  Branches    48310    48310           
=======================================
  Hits       174006   174006           
  Misses      28169    28169           
  Partials     3290     3290           
Flag Coverage Δ
hive 34.53% <ø> (ø)
mysql 52.55% <ø> (ø)
postgres 52.56% <ø> (-0.01%) ⬇️
presto 36.26% <ø> (ø)
python 87.73% <ø> (ø)
sqlite 52.32% <ø> (ø)
unit 82.45% <ø> (ø)

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Expected member names and unsupported-order rejection are unchanged; the three edited sites are the only mypy errors at the base.

@sadpandajoe
sadpandajoe merged commit 51fe5e0 into master Oct 29, 2026
83 checks passed
@sadpandajoe
sadpandajoe deleted the ultraset-mypy-semantic-testing-virtual-dataset-test-errors branch October 29, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:fix-master generated by AI to fix master branch size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants