You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by gr...@apache.org on 2021/06/22 18:09:23 UTC

[superset] branch master updated: Revert "fix: SQL Lab show "Refetch Results" button while fetching new query results (#15109)" (#15301)

This is an automated email from the ASF dual-hosted git repository.

graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 5b2eb8d  Revert "fix: SQL Lab show "Refetch Results" button while fetching new query results (#15109)" (#15301)
5b2eb8d is described below

commit 5b2eb8d9334b989d6aeeb4fb5b2a48e0f53142fb
Author: Grace Guo <gr...@airbnb.com>
AuthorDate: Tue Jun 22 11:08:29 2021 -0700

    Revert "fix: SQL Lab show "Refetch Results" button while fetching new query results (#15109)" (#15301)
    
    This reverts commit 408d58f937a544190ca64d13942a6a7b04b95615.
---
 superset-frontend/src/SqlLab/reducers/sqlLab.js | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/superset-frontend/src/SqlLab/reducers/sqlLab.js b/superset-frontend/src/SqlLab/reducers/sqlLab.js
index ec84381..daa06a9 100644
--- a/superset-frontend/src/SqlLab/reducers/sqlLab.js
+++ b/superset-frontend/src/SqlLab/reducers/sqlLab.js
@@ -517,20 +517,7 @@ export default function sqlLabReducer(state = {}, action) {
           if (changedQuery.changedOn > queriesLastUpdate) {
             queriesLastUpdate = changedQuery.changedOn;
           }
-          const prevState = state.queries[id].state;
-          const currentState = changedQuery.state;
-          newQueries[id] = {
-            ...state.queries[id],
-            ...changedQuery,
-            // race condition:
-            // because of async behavior, sql lab may still poll a couple of seconds
-            // when it started fetching or finished rendering results
-            state:
-              currentState === 'success' &&
-              ['fetching', 'success'].includes(prevState)
-                ? prevState
-                : currentState,
-          };
+          newQueries[id] = { ...state.queries[id], ...changedQuery };
           change = true;
         }
       });