kgabryje commented on a change in pull request #17512:
URL: https://github.com/apache/superset/pull/17512#discussion_r761278258
##########
File path: superset/charts/data/api.py
##########
@@ -221,6 +221,7 @@ def data(self) -> Response:
if json_body is None:
return self.response_400(message=_("Request is not JSON"))
+ form_data = json_body.pop("form_data", None)
Review comment:
> > A few small comments, but this works and looks great! It would be
nice if we could add a few tests:
> >
> > 1. Ensure that a query context with `form_data` validates successfully
> > 2. Add tests for `ExportToCSVDropdown` that ensures it renders correctly
with standard/pivoted options + the children.
>
> Added tests for `ExportToCSVDropdown`. I didn't add tests for query
context validation, as we pop form_data from json_body before it's used to
create context, so there's no change there.
Edit: After some discussion, I implemented Ville's suggestions. We already
had schema validations tests in place, so I just added `form_data` to query
context generator.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]