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 2022/04/01 17:05:51 UTC

[GitHub] [superset] codemaster08240328 commented on a change in pull request #19362: fix(sql lab): display the 'View Results' button consistently in the history tab on sync mode

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-unsubscribe@superset.apache.org

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



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