john-bodley commented on a change in pull request #4834: Load async sql lab 
results early for Presto
URL: 
https://github.com/apache/incubator-superset/pull/4834#discussion_r183947245
 
 

 ##########
 File path: superset/sql_lab.py
 ##########
 @@ -255,23 +237,27 @@ def handle_error(msg):
     query.end_time = utils.now_as_float()
     session.merge(query)
     session.flush()
+    new_key = query.results_key if cdf.data else 
utils.prefetch_key(query.results_key)
 
     payload.update({
         'status': query.status,
         'data': cdf.data if cdf.data else [],
+        'results_key': new_key,
         'columns': cdf.columns if cdf.columns else [],
         'query': query.to_dict(),
     })
     if store_results:
-        key = '{}'.format(uuid.uuid4())
+        if not query.results_key:
+            query.results_key = '{}'.format(uuid.uuid4())
 
 Review comment:
   See note above.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to