You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2026/10/11 08:21:33 UTC

(superset) branch ultraset-semantic-layer-metric-index-type-mismatch created (now ec55aaf0365)

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

sadpandajoe pushed a change to branch ultraset-semantic-layer-metric-index-type-mismatch
in repository https://gitbox.apache.org/repos/asf/superset.git


      at ec55aaf0365 fix(semantic-layer): narrow ValidatedQueryObject.metrics to list[str]

This branch includes the following new commits:

     new ec55aaf0365 fix(semantic-layer): narrow ValidatedQueryObject.metrics to list[str]

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: fix(semantic-layer): narrow ValidatedQueryObject.metrics to list[str]

Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sadpandajoe pushed a commit to branch ultraset-semantic-layer-metric-index-type-mismatch
in repository https://gitbox.apache.org/repos/asf/superset.git

commit ec55aaf03651544ae5cdb7872d6cb52d09f0bdf1
Author: Joe Li <47...@users.noreply.github.com>
AuthorDate: Sun Oct 11 08:21:08 2026 +0000

    fix(semantic-layer): narrow ValidatedQueryObject.metrics to list[str]
    
    The nightly full-repo mypy run flags mapper.py:402 as indexing a
    dict[str, Metric] (the semantic-layer Metric dataclass) with a key
    typed AdhocMetric | str, because QueryObject.metrics is typed
    list[Metric] | None using the unrelated superset.superset_typing.Metric
    alias. ValidatedQueryObject already narrows filter, series_columns and
    series_limit_metric for this same reason but missed metrics.
    _validate_metrics already guarantees every entry is a str before
    _map_query_object runs, so this only corrects the static type to match
    the existing runtime guarantee.
---
 superset/semantic_layers/mapper.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/superset/semantic_layers/mapper.py b/superset/semantic_layers/mapper.py
index c99c8e392f0..a054deb2f9a 100644
--- a/superset/semantic_layers/mapper.py
+++ b/superset/semantic_layers/mapper.py
@@ -125,6 +125,7 @@ class ValidatedQueryObject(QueryObject):
     filter: list[ValidatedQueryObjectFilterClause]  # type: ignore[assignment]
     series_columns: Sequence[str]  # type: ignore[assignment]
     series_limit_metric: str | None
+    metrics: list[str] | None  # type: ignore[assignment]
 
 
 @dataclass(frozen=True)