Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions superset/mcp_service/dataframe/tool/query_prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _flatten_prometheus_result(
metric = series.get("metric", {})
metric_labels = {str(k): str(v) for k, v in metric.items()}
for point in series.get("values", []):
if not isinstance(point, list | tuple) or len(point) != 2:
if not isinstance(point, (list, tuple)) or len(point) != 2:
continue
rows.append(
{
Expand All @@ -118,7 +118,7 @@ def _flatten_prometheus_result(
metric = series.get("metric", {})
metric_labels = {str(k): str(v) for k, v in metric.items()}
point = series.get("value", [])
if isinstance(point, list | tuple) and len(point) == 2:
if isinstance(point, (list, tuple)) and len(point) == 2:
rows.append(
{
**metric_labels,
Expand All @@ -129,7 +129,7 @@ def _flatten_prometheus_result(
return rows

if result_type in {"scalar", "string"}:
if isinstance(result, list | tuple) and len(result) == 2:
if isinstance(result, (list, tuple)) and len(result) == 2:
rows.append(
{
"timestamp": _format_timestamp(result[0]),
Expand Down
Loading