This is an automated email from the ASF dual-hosted git repository.
sadpandajoe pushed a commit to branch ultraset-mh-dataset-scope-mypy-2
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to
refs/heads/ultraset-mh-dataset-scope-mypy-2 by this push:
new 2f3c08b4bb8 fix(mypy): keep the new dataset-scope ignores from firing
unused-ignore
2f3c08b4bb8 is described below
commit 2f3c08b4bb8023da20dcb09d8bd3dc72abaa1a84
Author: Joe Li <[email protected]>
AuthorDate: Thu Sep 24 14:38:10 2026 +0000
fix(mypy): keep the new dataset-scope ignores from firing unused-ignore
`warn_unused_ignores` is on globally, and the two `.in_()` ignores added
alongside it are only *used* when superset-core's sources are part of the
same mypy run. The nightly lint is `prek run --all-files`, so it sees
`superset_core.common.models.Dataset`'s plain `id: int` / `uuid: UUID |
None`
annotations shadowing the SQLAlchemy columns and reports the errors. Per-PR
CI is `prek run --files <changed>`, where `superset_core` is unresolvable
and
falls back to `Any` -- the `.in_()` calls check clean and both ignores are
flagged `unused-ignore`, failing the very job this branch has to keep green.
Exempt the two modules from `warn_unused_ignores`, the same remedy already
applied to `superset.connectors.sqla.models` and friends for the
mirror-image
superset-core visibility problem.
Co-Authored-By: Claude Opus 5 <[email protected]>
---
pyproject.toml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/pyproject.toml b/pyproject.toml
index 3756ebb7d23..01f70ecc867 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -398,6 +398,17 @@ module = [
]
warn_unused_ignores = false
+# The mirror case: superset-core declares SqlaTable's id/uuid/perm as plain
+# value types, so column expressions like SqlaTable.uuid.in_() only need a
+# type: ignore when superset-core's sources are part of the same mypy run
+# (full-repo lint) and not when only changed files are checked.
+[[tool.mypy.overrides]]
+module = [
+ "superset.mcp_service.dataset_scope",
+ "tests.unit_tests.mcp_service.dataset.tool.test_dataset_tools",
+]
+warn_unused_ignores = false
+
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [