Repository navigation
fix(typing): restore full-tree mypy for semantic-layer testing kit and mapper tests - #46359
Merged
sadpandajoe merged 1 commit intoNov 20, 2026
Merged
Conversation
…d mapper tests The scheduled full-tree mypy run reports 17 errors that per-PR runs miss, because superset_core.* is follow_imports=skip and resolves to Any when only changed files are checked. - testing.py (#45893): the `Dimension | None` annotation on the min(..., default=None) result made mypy infer the element type as `Dimension | None`, so the `Dimension`-typed key function no longer matched. Let mypy infer the result type instead. - mapper_test.py (#46339): narrow `SemanticQuery.filters` and each member to `Filter` (and its column to non-None) before reading `.column.id` / `.value`, keeping the same assertions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46359 +/- ##
=======================================
Coverage 85.58% 85.58%
=======================================
Files 3106 3106
Lines 214408 214408
Branches 50662 50662
=======================================
Hits 183507 183507
Misses 27481 27481
Partials 3420 3420
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
approved these changes
Nov 19, 2026
aminghadersohi
left a comment
Contributor
There was a problem hiding this comment.
Narrowing keeps each mapper assertion as strict as before, and the dropped annotation leaves the inferred type unchanged.
sadpandajoe
deleted the
ultraset-semantic-layers-full-tree-mypy-errors
branch
November 20, 2026 00:51
hainenber
pushed a commit
that referenced
this pull request
Nov 21, 2026
…d mapper tests (#46359) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
SUMMARY
The scheduled full-tree
pre-commitrun failsmypy (main)with 17 errors in two files. Per-PR runs only check changed files, wheresuperset_core.*(follow_imports = "skip") resolves toAny, so neither PR caught them.superset-core/src/superset_core/semantic_layers/testing.py, introduced by test(semantic-layer): validate provider-declared default time dimensions #45893: theDimension | Noneannotation on amin(..., default=None)result made mypy infer the element type asDimension | None, which no longer matched theDimension-typed key function. The annotation is dropped; mypy infersDimension | Noneon its own.tests/unit_tests/semantic_layers/mapper_test.py, introduced by fix(semantic-layer): ignore inapplicable time grains #46339: three new assertions read.column.id/.valuefromSemanticQuery.filters(set[Filter | OrFilter] | None) without narrowing. They now narrow it to non-None and toFilterleaves, and still assert that exactly twoFilterleaves exist, so the checks are as strict as before.Test-only typing changes; no product code is touched.
TESTING INSTRUCTIONS
pre-commit run mypy --all-files: no errors are reported intesting.pyormapper_test.py(17 before this change).pytest tests/unit_tests/semantic_layers/ superset-core/tests/semantic_layers/: all pass.ADDITIONAL INFORMATION
🤖 Generated with Claude Code