nightly mypy (main) fails on version_restore_tests.py: UUID | None passed to RestoreChartVersionCommand
Master's nightly full-repo mypy check (.github/workflows/pre-commit.yml, job "pre-commit (next)", hook "mypy (main)") has failed for 3 consecutive nightly runs (2026-09-15, 16, 17):
tests/integration_tests/charts/version_restore_tests.py:221: error: Argument 1 to "RestoreChartVersionCommand" has incompatible type "UUID | None"; expected "UUID" [arg-type]
tests/integration_tests/charts/version_restore_tests.py:280: error: Argument 1 to "RestoreChartVersionCommand" has incompatible type "UUID | None"; expected "UUID" [arg-type]
tests/integration_tests/charts/version_restore_tests.py:319: error: Argument 1 to "RestoreChartVersionCommand" has incompatible type "UUID | None"; expected "UUID" [arg-type]
First failing run: https://github.com/apache/superset/actions/runs/34936791507
Not caught by push-triggered CI, which only lints changed files.
Root cause: #44015 added three chart_uuid = chart.uuid reads (test file lines 196, 257, 302) from UUIDMixin.uuid (mypy-inferred UUID | None) and passed them unnarrowed into RestoreChartVersionCommand(entity_uuid: UUID, ...). The existing idiom elsewhere in this file, from #42654, is assert chart_uuid is not None right after each .uuid read; these three call sites omit it.
Fix: add assert chart_uuid is not None after each of the three reads, matching the established pattern. PR incoming.
Source: apache/superset