mikebridge commented on code in PR #44370:
URL: https://github.com/apache/superset/pull/44370#discussion_r4054440015


##########
superset/mcp_service/semantic_layer/schemas.py:
##########
@@ -81,6 +81,7 @@ class MetricInfo(BaseModel):
     dataset_name: str | None = None
     view_id: int | None = None
     view_name: str | None = None
+    semantic_selection_version: str | None = None

Review Comment:
   Published in 503155699807719fc03c41795410035959d27bec: compatible metrics 
expose the semantic selection version. The pushed tree exactly matches the 
independently approved snapshot. Verification: 880 backend tests, 103 Jest 
tests, and required branch-file hooks passed.



##########
superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts:
##########
@@ -584,6 +658,21 @@ export default function getFormDataWithExtraFilters({
     ...groupByFormData,
     ...customizationExtraFormData,
     ...(chartCustomization && { chart_customization: chartCustomization }),
+    // Customizations can rewrite member fields outside extra_form_data.
+    ...(chart.form_data?.semantic_selection_version && {
+      semantic_selection_sources: [
+        ...(chart.form_data.semantic_selection_sources ?? []),
+        ...customizationIds.flatMap(id =>
+          getCustomizationSelectionSources({
+            customization: chartCustomizationItems?.find(
+              item => item.id === id,
+            ),
+            mask: dataMask[id],
+            groupByApplied: appliedGroupByIds.has(id),
+          }),
+        ),
+      ],
+    }),

Review Comment:
   Published in 503155699807719fc03c41795410035959d27bec: the chart cache 
invalidates when identity inputs change. The pushed tree exactly matches the 
independently approved snapshot. Verification: 880 backend tests, 103 Jest 
tests, and required branch-file hooks passed.



##########
superset-frontend/src/components/Chart/ChartRenderer.tsx:
##########
@@ -381,9 +381,26 @@ function ChartRendererComponent({
 
   const setDataMaskCallback = useCallback(
     (dataMask: DataMask) => {
-      actions?.updateDataMask?.(chartId, dataMask);
+      const sourceForm = latestQueryFormData ?? formData;
+      actions?.updateDataMask?.(
+        chartId,
+        sourceForm.datasource?.endsWith('__semantic_view')
+          ? {
+              ...dataMask,
+              extraFormData: {
+                ...dataMask.extraFormData,
+                semantic_selection_sources: [
+                  {
+                    datasource: sourceForm.datasource,
+                    version: sourceForm.semantic_selection_version ?? null,
+                  },
+                ],

Review Comment:
   Published in 503155699807719fc03c41795410035959d27bec: chart masks preserve 
incoming and source-query provenance. The pushed tree exactly matches the 
independently approved snapshot. Verification: 880 backend tests, 103 Jest 
tests, and required branch-file hooks passed.



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