sadpandajoe opened a new issue, #44423:
URL: https://github.com/apache/superset/issues/44423

   ### Symptom
   Nightly full-repo pre-commit run fails mypy with 23 errors in 4 files, all 
"incompatible type UUID | None; expected UUID" (or str | None union-attr) 
variants: 
https://github.com/apache/superset/actions/runs/35314646451/job/105503592938
   
   - 
`tests/integration_tests/versioning/conditional_token_lock_tests.py:154,157,190,241,305`
   - 
`tests/integration_tests/versioning/restore_fails_closed_tests.py:149,375,380,399,432,468,536,615`
   - 
`tests/integration_tests/versioning/creation_row_tests.py:144,169,193,205,220,247,264,292,303`
   - `tests/integration_tests/versioning/activity_write_after_read_tests.py:95`
   
   ### Root cause
   Unguarded reads of nullable SQLAlchemy Column attributes (`UUIDMixin.uuid` 
at `superset/models/helpers.py:751`, mypy-inferred `UUID | None`; 
`BaseDatasource.description` at `superset/connectors/sqla/models.py:223`) 
passed unnarrowed into strictly-typed callees (`get_activity`, 
`derive_version_uuid`, `restore_version`, 
`VersionDAO.current_live_transaction_id(_locked)`). `creation_row_tests.py` and 
`activity_write_after_read_tests.py` came in with #44258; 
`restore_fails_closed_tests.py` is from #44251 and 
`conditional_token_lock_tests.py` from #44091 — both pre-existing latent 
errors, surfaced now because `.github/workflows/pre-commit.yml` only runs the 
"next" mypy leg on push/schedule, not on `pull_request`, so this was the first 
`--all-files` sweep to exercise it since those PRs merged. Same bug class as 
#44384 / #44394 (identical `UUID | None` pattern in a different file).
   
   ### Fix
   `assert <value> is not None` immediately after each nullable read at the 23 
flagged call sites, matching the idiom from #44394/#42654 — test-only change, 
PR incoming.
   
   ### Evidence
   - Raw job log for job 105503592938 shows the mypy output.
   - Reproduced 22 of 23 diagnostics locally with mypy 1.15.0 (pinned version) 
against the 4 files.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to