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 2020/07/14 09:37:37 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #10300: fix(chart-data-api): improve chart data endpoint errors

dpgaspar commented on a change in pull request #10300:
URL: https://github.com/apache/incubator-superset/pull/10300#discussion_r454231147



##########
File path: superset/charts/api.py
##########
@@ -465,13 +465,16 @@ def data(self) -> Response:
             return self.response_400(message="Request is incorrect")
         except ValidationError as error:
             return self.response_400(
-                _("Request is incorrect: %(error)s", error=error.messages)
+                message=_("Request is incorrect: %(error)s", error=error.messages)
             )
         try:
             query_context.raise_for_access()
         except SupersetSecurityException:
             return self.response_401()
         payload = query_context.get_payload()
+        for query in payload:
+            if query["error"]:
+                return self.response_400(message=f"Error: {query['error']}")

Review comment:
       Would be great if `query_context.get_payload()` would raise custom superset exceptions instead of checking for errors on the payload. But we can address that later




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



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