mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(viz): deduce metric name if empty (#16194)
* fix(viz): deduce metric name if empty * fix unit test
This commit is contained in:
@@ -177,7 +177,7 @@ class QueryObject:
|
||||
# 2. { label: 'label_name' } - legacy format for a predefined metric
|
||||
# 3. { expressionType: 'SIMPLE' | 'SQL', ... } - adhoc metric
|
||||
self.metrics = metrics and [
|
||||
x if isinstance(x, str) or is_adhoc_metric(x) else x["label"]
|
||||
x if isinstance(x, str) or is_adhoc_metric(x) else x["label"] # type: ignore
|
||||
for x in metrics
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user