codemaster08240328 commented on a change in pull request #19362:
URL: https://github.com/apache/superset/pull/19362#discussion_r840770181



##########
File path: superset-frontend/src/SqlLab/components/ResultSet/index.tsx
##########
@@ -247,9 +247,12 @@ export default class ResultSet extends React.PureComponent<
         this.clearQueryResults(nextProps.query),
       );
     }
+
     if (
-      nextProps.query.resultsKey &&
-      nextProps.query.resultsKey !== this.props.query.resultsKey
+      (this.props.query.resultsKey &&
+        nextProps.query.resultsKey &&
+        nextProps.query.resultsKey !== this.props.query.resultsKey) ||
+      (nextProps.query.id !== this.props.query.id && 
nextProps.query.resultsKey)

Review comment:
       Can you add some comments here to explain why we need 2 more conditions 
here?

##########
File path: superset/sql_lab.py
##########
@@ -528,6 +528,8 @@ def execute_sql_statements(  # pylint: 
disable=too-many-arguments, too-many-loca
 
     if store_results and results_backend:
         key = str(uuid.uuid4())
+        payload["query"]["resultsKey"] = key

Review comment:
       I think instead of adding this line here, it would be more 
understandable to others to add this into line# 554. Then, others would 
understand easily that we need to add results_key into payload when we update 
the db.




-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to