aminghadersohi commented on code in PR #37142:
URL: https://github.com/apache/superset/pull/37142#discussion_r2696226301
##########
superset/mcp_service/chart/tool/get_chart_data.py:
##########
@@ -161,6 +161,24 @@ async def get_chart_data( # noqa: C901
or form_data.get("row_limit")
or current_app.config["ROW_LIMIT"]
)
+
+ # Handle different chart types that have different form_data
structures
+ # Some charts use "metric" (singular), not "metrics" (plural):
+ # - big_number, big_number_total
+ # - pop_kpi (BigNumberPeriodOverPeriod)
+ # These charts also don't have groupby columns
+ viz_type = chart.viz_type or ""
+ single_metric_types = ("big_number", "pop_kpi")
+ if viz_type.startswith("big_number") or viz_type in
single_metric_types:
+ # These chart types use "metric" (singular)
+ metric = form_data.get("metric")
+ metrics = [metric] if metric else []
+ groupby_columns: list[str] = [] # These charts don't
group by
Review Comment:
This suggestion is not applicable to this codebase. Superset requires
**Python >= 3.10** (see `pyproject.toml`: `requires-python = ">=3.10"`), so
`list[str]` is valid and is the preferred modern Python syntax.
The project's `mcp_service/CLAUDE.md` explicitly states to use Python 3.10+
style type hints:
> **CRITICAL**: Always use modern Python 3.10+ union syntax for type hints.
Using `List[str]` from typing would actually violate the project's coding
standards.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]