ktmud commented on a change in pull request #10270:
URL: https://github.com/apache/superset/pull/10270#discussion_r557771017
##########
File path: superset/charts/api.py
##########
@@ -561,9 +561,13 @@ def data(self) -> Response:
command = ChartDataCommand()
query_context = command.set_query_context(json_body)
command.validate()
+ except QueryObjectValidationError as error:
+ return self.response_400(message=error.message)
except ValidationError as error:
return self.response_400(
- message=_("Request is incorrect: %(error)s",
error=error.messages)
+ message=_(
+ "Request is incorrect: %(error)s",
error=error.normalized_messages()
+ )
Review comment:
Use `normalized_messsages` from mashmallow's `ValidationError` so that
the error message shows which query field failed the validation.
----------------------------------------------------------------
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]