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:51:57 UTC

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

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

 ##########
 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:
   I was debating whether to use 404, which I think fits better, or 410 like a previous similar error message used. I'll use 404 to make it easier to differentiate.

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