Copilot commented on code in PR #39919:
URL: https://github.com/apache/superset/pull/39919#discussion_r3205011663


##########
superset/mcp_service/dashboard/tool/generate_dashboard.py:
##########
@@ -230,7 +230,10 @@ def generate_dashboard(  # noqa: C901
                 return GenerateDashboardResponse(
                     dashboard=None,
                     dashboard_url=None,
-                    error=f"Charts not found: {list(missing_chart_ids)}",
+                    error=(
+                        f"Charts not found: {list(missing_chart_ids)}."

Review Comment:
   `missing_chart_ids` is a `set`, so `list(missing_chart_ids)` produces a 
non-deterministic order. This makes the error message unstable across 
runs/tests and harder to diff in logs; consider using 
`sorted(missing_chart_ids)` (and/or joining as a stable string) when 
constructing the message.
   



##########
superset/mcp_service/chart/tool/get_chart_preview.py:
##########
@@ -1193,7 +1193,10 @@ def __init__(self, form_data: Dict[str, Any]):
         if not chart:
             await ctx.warning("Chart not found: identifier=%s" % 
(request.identifier,))
             return ChartError(
-                error=f"No chart found with identifier: {request.identifier}",
+                error=(
+                    f"No chart found with identifier: {request.identifier}."
+                    " Use list_charts to get valid chart IDs."
+                ),

Review Comment:
   The suggested recovery action here always points to `list_charts`, but this 
code path also runs when `identifier` is a string that looks like a 
`form_data_key` (the function attempts that fallback just above). If the 
identifier is actually an unsaved `form_data_key` (or an invalid one), 
`list_charts` won’t help; consider tailoring the message (e.g., mention 
providing a valid `form_data_key` / retrying with `form_data_key` when 
applicable) based on the identifier type/shape.



-- 
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]

Reply via email to