aminghadersohi commented on code in PR #40473:
URL: https://github.com/apache/superset/pull/40473#discussion_r3328110750
##########
superset/mcp_service/chart/tool/get_chart_info.py:
##########
@@ -213,7 +214,7 @@ def _apply_unsaved_state_override(result: ChartInfo,
form_data_key: str) -> None
)
async def get_chart_info(
request: GetChartInfoRequest, ctx: Context
-) -> ChartInfo | ChartError:
+) -> dict[str, Any] | ChartError:
"""Get chart metadata by ID or UUID.
Review Comment:
Fixed in 1f4b65d9ab — the unsaved-chart branch (form_data_key only, no
identifier) now calls `result.model_dump(mode="json",
context={"select_columns": request.select_columns})`, matching the saved-chart
path.
##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -288,6 +288,33 @@ def validate_search_and_filters(self) ->
"ListDashboardsRequest":
return self
+DEFAULT_GET_DASHBOARD_INFO_COLUMNS: List[str] = [
+ "id",
+ "dashboard_title",
+ "slug",
+ "description",
+ "certified_by",
+ "certification_details",
+ "published",
+ "is_managed_externally",
+ "external_url",
+ "created_on",
+ "changed_on",
+ "uuid",
+ "url",
+ "created_on_humanized",
+ "changed_on_humanized",
+ "chart_count",
+ "tags",
+ "charts",
+ "native_filters",
+ "cross_filters_enabled",
+ "is_permalink_state",
+ "permalink_key",
+ "filter_state",
+]
Review Comment:
Fixed — `filter_state` was removed from `DEFAULT_GET_DASHBOARD_INFO_COLUMNS`
in commit 1f4b65d9ab. The lean default no longer includes it; callers who need
it can pass it explicitly via `select_columns`.
##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -288,6 +288,33 @@ def validate_search_and_filters(self) ->
"ListDashboardsRequest":
return self
+DEFAULT_GET_DASHBOARD_INFO_COLUMNS: List[str] = [
+ "id",
+ "dashboard_title",
+ "slug",
+ "description",
+ "certified_by",
+ "certification_details",
+ "published",
+ "is_managed_externally",
+ "external_url",
+ "created_on",
+ "changed_on",
+ "uuid",
+ "url",
+ "created_on_humanized",
+ "changed_on_humanized",
+ "chart_count",
+ "tags",
+ "charts",
+ "native_filters",
+ "cross_filters_enabled",
+ "is_permalink_state",
+ "permalink_key",
+ "filter_state",
+]
Review Comment:
Fixed — `filter_state` was removed from `DEFAULT_GET_DASHBOARD_INFO_COLUMNS`
in commit 1f4b65d9ab. The lean default no longer includes it; callers who need
it can pass it explicitly via `select_columns`.
##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -288,6 +288,33 @@ def validate_search_and_filters(self) ->
"ListDashboardsRequest":
return self
+DEFAULT_GET_DASHBOARD_INFO_COLUMNS: List[str] = [
+ "id",
+ "dashboard_title",
+ "slug",
+ "description",
+ "certified_by",
+ "certification_details",
+ "published",
+ "is_managed_externally",
+ "external_url",
+ "created_on",
+ "changed_on",
+ "uuid",
+ "url",
+ "created_on_humanized",
+ "changed_on_humanized",
+ "chart_count",
+ "tags",
+ "charts",
+ "native_filters",
+ "cross_filters_enabled",
+ "is_permalink_state",
+ "permalink_key",
+ "filter_state",
+]
Review Comment:
Fixed — `filter_state` was removed from `DEFAULT_GET_DASHBOARD_INFO_COLUMNS`
in commit 1f4b65d9ab. The lean default no longer includes it; callers who need
it can pass it explicitly via `select_columns`.
##########
superset/mcp_service/dashboard/schemas.py:
##########
@@ -312,6 +339,29 @@ class GetDashboardInfoRequest(MetadataCacheControl):
"from that permalink."
),
)
+ select_columns: Annotated[
+ List[str],
+ Field(
+ default_factory=lambda: list(DEFAULT_GET_DASHBOARD_INFO_COLUMNS),
+ description=(
+ "Top-level fields to include in the response. Defaults to a
lean "
+ "set that excludes 'css' (raw CSS, can be many KB) and
'filter_state' "
+ "(only relevant when permalink_key is provided). Pass an
explicit list "
+ "to override, e.g. ['id','dashboard_title','charts'] for
minimal "
+ "output, or add 'css' to include raw dashboard CSS."
+ ),
+ ),
+ ]
+
+ @field_validator("select_columns", mode="before")
+ @classmethod
+ def _parse_select_columns(cls, value: Any) -> Any:
+ from superset.mcp_service.utils.schema_utils import parse_json_or_list
+
+ if value is None:
+ return list(DEFAULT_GET_DASHBOARD_INFO_COLUMNS)
+ result = parse_json_or_list(value, "select_columns")
+ return result or list(DEFAULT_GET_DASHBOARD_INFO_COLUMNS)
Review Comment:
Fixed — `filter_state` was removed from `DEFAULT_GET_DASHBOARD_INFO_COLUMNS`
in commit 1f4b65d9ab. The lean default no longer includes it; callers who need
it can pass it explicitly via `select_columns`.
--
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]