mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: annotate important types (#36034)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1618,7 +1618,9 @@ def get_column_name_from_metric(metric: Metric) -> str | None:
|
||||
if is_adhoc_metric(metric):
|
||||
metric = cast(AdhocMetric, metric)
|
||||
if metric["expressionType"] == AdhocMetricExpressionType.SIMPLE:
|
||||
return cast(dict[str, Any], metric["column"])["column_name"]
|
||||
column = metric["column"]
|
||||
if column:
|
||||
return column["column_name"]
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user