This is an automated email from the ASF dual-hosted git repository.

hainenber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ccae7784982 fix(mypy): ignore false-positive union-attr on 
Slice.uuid.in_() (#44944)
ccae7784982 is described below

commit ccae77849824db1fb3bc8c0107b6fb109fbb31c4
Author: Joe Li <[email protected]>
AuthorDate: Sat Oct 3 21:48:28 2026 -0700

    fix(mypy): ignore false-positive union-attr on Slice.uuid.in_() (#44944)
    
    Co-authored-by: Claude Sonnet 5 <[email protected]>
---
 pyproject.toml                                   | 10 ++++++----
 superset/commands/chart/importers/v1/__init__.py |  7 ++++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 543f81999f8..8c97ca10521 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -405,14 +405,16 @@ 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.
+# The mirror case: superset-core declares SqlaTable's id/uuid/perm, and
+# Chart's uuid, as plain value types, so column expressions like
+# SqlaTable.uuid.in_() and Slice.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",
+    "superset.commands.chart.importers.v1",
 ]
 warn_unused_ignores = false
 
diff --git a/superset/commands/chart/importers/v1/__init__.py 
b/superset/commands/chart/importers/v1/__init__.py
index a2552d0a1a7..e5528e0df5f 100644
--- a/superset/commands/chart/importers/v1/__init__.py
+++ b/superset/commands/chart/importers/v1/__init__.py
@@ -159,7 +159,12 @@ class ImportChartsCommand(ImportModelsCommand):
             {
                 str(chart_uuid)
                 for (chart_uuid,) in db.session.query(Slice.uuid).filter(
-                    Slice.uuid.in_(dependency_chart_uuids)
+                    # Slice.uuid comes only from the 
ImportExportMixin/UUIDMixin
+                    # chain, so in a full-repo mypy run mypy resolves it 
through
+                    # CoreChart's plain `uuid: UUID | None` annotation instead 
of
+                    # the Column descriptor; same false positive already 
ignored
+                    # in superset/mcp_service/dataset_scope.py.
+                    Slice.uuid.in_(dependency_chart_uuids)  # type: 
ignore[union-attr]
                 )
             }
             if dependency_chart_uuids

Reply via email to