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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]