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

   ### Problem
   mypy fails with 10 `arg-type`/`union-attr` errors in two new versioning test 
files, both reading nullable ORM columns unnarrowed: 
`tests/unit_tests/versioning/test_restore_datasource_race.py:90,100,155,161` 
and 
`tests/unit_tests/versioning/test_restore_missing_datasource.py:116,147,186,226,235,282`.
 First failing run: https://github.com/apache/superset/actions/runs/37737577267 
(job "pre-commit (current)" → mypy hook, workflow "pre-commit checks").
   
   ### Root cause
   PR #44925 (commit 0cb498d08f) added both files and passed `chart.uuid` 
(superset-core `Chart.uuid`, typed `UUID | None`) straight into 
`derive_version_uuid(entity_uuid: UUID, ...)` at 
`superset/versioning/queries.py:65`, and assigned 
`SqlaTable`/`Dataset.uuid`/`.perm` (`UUID | None` / `str | None`) into 
`UUID`/`str`-annotated locals, without the `assert x is not None` narrowing 
used elsewhere in this test suite (#42654, #44394, #44424, #44648, #44789, 
#44610, #44944).
   
   ### Steps to reproduce
   Run `mypy --check-untyped-defs` including `superset-core/src` alongside the 
two test files:
   ```
   mypy --check-untyped-defs superset-core/src 
tests/unit_tests/versioning/test_restore_datasource_race.py 
tests/unit_tests/versioning/test_restore_missing_datasource.py
   ```
   This reproduces all 10 errors byte-for-byte on the pre-fix tree.
   
   (Found via automated investigation — [Agor](https://agor.live/).)
   


-- 
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