xtinec commented on a change in pull request #6220: [SIP-5] Open a new
/api/v1/query endpoint that takes query_obj
URL:
https://github.com/apache/incubator-superset/pull/6220#discussion_r229860852
##########
File path: superset/views/core.py
##########
@@ -1200,17 +1186,30 @@ def annotation_json(self, layer_id):
form_data=form_data,
force=False,
)
- try:
- payload = viz_obj.get_payload()
- except Exception as e:
- logging.exception(e)
- return json_error_response(utils.error_msg_from_exception(e))
- status = 200
- if payload.get('status') == QueryStatus.FAILED:
- status = 400
- return json_success(viz_obj.json_dumps(payload), status=status)
+ payload_json_and_error = viz_obj.get_payload_json_and_error()
+ return self.payload_response(payload_json_and_error)
@log_this
+ @api
+ @handle_superset_exception
+ @has_access_api
+ @expose('/api/v1/query/', methods=['POST'])
Review comment:
Yeah, I did a quick look around as well for how much needs to be moved to
have a proper `api` folder under `app`. It is a non-trivial amount and probably
not a priority to tackle right now.
I'll stick with `{ROOT}/views/api.py` for now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]