aminghadersohi commented on code in PR #43771:
URL: https://github.com/apache/superset/pull/43771#discussion_r3972016420
##########
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:
Addressed: saved preview canonicalization stamps `chart.viz_type` for every
chart type, not only Gauge. Existing parameterized Gauge stale/missing-viz
tests and Sunburst preview coverage exercise the shared path; MyPy and Ruff
pass.
--
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]