You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/09/04 17:11:10 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #8060: SIP-23: Persist SQL Lab state in the backend

etr2460 commented on a change in pull request #8060: SIP-23: Persist SQL Lab state in the backend
URL: https://github.com/apache/incubator-superset/pull/8060#discussion_r320851512
 
 

 ##########
 File path: superset/assets/src/SqlLab/actions/sqlLab.js
 ##########
 @@ -165,7 +188,18 @@ export function fetchQueryResults(query) {
     })
       .then(({ text = '{}' }) => {
         const bigIntJson = JSONbig.parse(text);
-        dispatch(querySuccess(query, bigIntJson));
+        const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
+          ? SupersetClient.put({
+              endpoint: encodeURI(`/tabstateview/${bigIntJson.query.sqlEditorId}`),
+              postPayload: { query_id: bigIntJson.query_id },
+            })
+          : Promise.resolve();
+
+        return sync
+          .then(() => dispatch({ type: QUERY_SUCCESS, query, results: bigIntJson }))
+          .catch(() =>
+            dispatch(addDangerToast(t('An error occurred while updating tab query'))),
 
 Review comment:
   Same comment here about the error message

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org