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/08/14 21:26:43 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #8037: fix: handle case where result exists but corresponding query cannot be found

etr2460 commented on a change in pull request #8037: fix: handle case where result exists but corresponding query cannot be found
URL: https://github.com/apache/incubator-superset/pull/8037#discussion_r314090865
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -2398,7 +2398,13 @@ def results(self, key):
                 status=410,
             )
 
-        query = db.session.query(Query).filter_by(results_key=key).one()
+        query = db.session.query(Query).filter_by(results_key=key).one_or_none()
+        if query is None:
+            return json_error_response(
+                "Data could not be retrieved. You may want to re-run the query.",
+                status=410,
 
 Review comment:
   Is this the proper status code? if the query isn't found, then I think 404 might be better

----------------------------------------------------------------
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