sadpandajoe commented on code in PR #43771:
URL: https://github.com/apache/superset/pull/43771#discussion_r3971744441


##########
superset/mcp_service/chart/tool/get_chart_preview.py:
##########
@@ -220,6 +232,30 @@ def _authorize_guest_query(self, query_context: Any) -> 
None:
         if (dashboard_id := guest_scope.guest_dashboard_id(self.chart)) is not 
None:
             guest_scope.authorize_query(query_context, dashboard_id, 
self.chart)
 
+    def _canonical_form_data(self, form_data: dict[str, Any]) -> dict[str, 
Any]:
+        """Bind saved-preview identity to the resolved chart and datasource."""
+        canonical = canonicalize_operation_form_data(
+            form_data,
+            datasource_id=self.chart.datasource_id,
+            datasource_type=self.chart.datasource_type,
+            chart_id=self.chart.id,
+        )
+        if self.chart.viz_type == "gauge_chart":

Review Comment:
   Only Gauge restores the saved chart's `viz_type` here. For a Sunburst chart 
whose stored params omit or retain a stale `viz_type`, strategy dispatch uses 
`chart.viz_type` while the renderer/query builder uses form data, so the 
preview falls back to a generic table or builds the wrong query. Can this apply 
the chart viz type for every saved preview?



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