Conversation
Code Review Agent Run #6ed1dfActionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44424 +/- ##
==========================================
- Coverage 80.57% 80.56% -0.01%
==========================================
Files 2940 2940
Lines 175316 175316
Branches 40696 40696
==========================================
- Hits 141253 141251 -2
- Misses 31398 31400 +2
Partials 2665 2665
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:
|
Summary
Fixes the 23 mypy
UUID | Noneerrors the nightly pre-commit (next) sweep flagged in the four versioning test files (#44423).UUIDMixin.uuid(superset/models/helpers.py:751) is a nullablesa.Column, so mypy infersUUID | Nonefor instance reads; the tests passed it (andBaseDatasource.description,str | None) unnarrowed into strictly-typed callees.Change is test-only: hoist the read into an annotated local and
assert <local> is not Nonebefore the flagged call, matching the idiom from #44394/#42654. Where a narrowed local already existed (chart_uuid,dataset_uuid,slc_uuid), the assert lands right after its assignment and downstream call sites use the local;restore_fails_closed_tests.py:375narrows theremovesuffixreceiver with(dataset.description or "")since the target-version suffix is expected on a present description.Behavioral analysis
No runtime behavior change intended; every touched entity (chart/slice/dashboard/dataset fixtures) mints its uuid via
default=uuid.uuid4on insert and is committed before the asserted read, so the asserts are statically-load-bearing but unreachable in practice.Test plan
mypy --check-untyped-defs(1.15.0, the pinned pre-commit rev) clean on the 4 filespython -c "import ast; ast.parse(...)"on all 4 filesAdditional context
Closes #44423. Same defect class as #44384/#44394; surfaced now because the
nextmypy leg only runs on push/schedule (first--all-filessweep since #44258/#44251/#44091 merged).