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


##########
superset-frontend/src/dashboard/actions/dashboardState.ts:
##########
@@ -937,7 +951,16 @@ export function addSliceToDashboard(
 
     return Promise.all([
       dispatch(addChart(newChart, id)),
-      dispatch(fetchDatasourceMetadata(form_data.datasource as string)),
+      dispatch(
+        fetchDatasourceMetadata(
+          form_data.datasource as string,
+          (form_data.datasource as string).endsWith(
+            `__${DatasourceType.SemanticView}`,
+          )
+            ? getState().dashboardInfo.id
+            : undefined,
+        ),
+      ),
     ]).then(() => {
       dispatch(addSlice(selectedSlice as Slice));
     });

Review Comment:
   Good catch on the partially added chart when an ordinary datasource request 
fails. The same `Promise.all` sequencing is present at the merge-base 
(`dashboardState.ts:938-943`), and the ordinary fetch still rejects at head 
(`datasources.ts:93-95`); this PR changes only semantic datasource handling. 
The ordinary datasource failure path is pre-existing and better handled in its 
own follow-up.



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