You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "sadpandajoe (via GitHub)" <gi...@apache.org> on 2026/10/17 08:17:18 UTC
[I] Nightly pre-commit fails: mypy Filter|OrFilter errors in the E2E semantic stub and its test [superset]
sadpandajoe opened a new issue, #45418:
URL: https://github.com/apache/superset/issues/45418
### Problem
The nightly full-repo `pre-commit` run on `master` fails mypy with 3 errors in the E2E semantic stub and its test: https://github.com/apache/superset/actions/runs/39009521208
```
tests/e2e_extensions/semantic_stub/dist/backend/src/superset_e2e_semantic_stub/__init__.py:166: Argument 1 to "_filtered_rows" has incompatible type "set[Filter | OrFilter] | None"; expected "set[Filter] | None" [arg-type]
tests/unit_tests/semantic_layers/e2e_stub_extension_test.py:120: "type[SemanticLayer[Any, Any]]" has no attribute "name" [attr-defined]
tests/unit_tests/semantic_layers/e2e_stub_extension_test.py:232: Argument "filters" to "SemanticQuery" has incompatible type "set[Filter]"; expected "set[Filter | OrFilter] | None" [arg-type]
```
The first is also a runtime defect: the mapper builds an `OrFilter` for an `IN` filter that includes NULL (`superset/semantic_layers/mapper.py:969-998`), and the stub crashes with `AttributeError: 'OrFilter' object has no attribute 'type'` at `__init__.py:99` instead of refusing the query.
### Root cause
#45103 (a5d29a9) typed the stub and its test with `set[Filter]`, but #45133 (f5404f7) had already widened `SemanticQuery.filters` to `FilterExpression = Filter | OrFilter` (`superset-core/src/superset_core/semantic_layers/types.py:303,389`). `SemanticLayer` does not declare `name` (the decorator sets it at runtime, `superset/core/api/core_api_injection.py:273`). PR mypy runs skip `superset_core` (`pyproject.toml:394-396`, `follow_imports = skip`), so only the nightly run sees it.
### Steps to reproduce
With mypy 1.15.0 and the pre-commit hook's `types-*` stubs, on `master`:
```
mypy --check-untyped-defs tests/e2e_extensions/semantic_stub/dist/backend/src/superset_e2e_semantic_stub/__init__.py tests/unit_tests/semantic_layers/e2e_stub_extension_test.py $(git ls-files 'superset-core/*.py')
```
(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: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Nightly pre-commit fails: mypy Filter|OrFilter errors in the E2E semantic stub and its test [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe closed issue #45418: Nightly pre-commit fails: mypy Filter|OrFilter errors in the E2E semantic stub and its test
URL: https://github.com/apache/superset/issues/45418
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org