Takes a query_obj constructed in the client and returns payload data response for the given query_obj. raises SupersetSecurityException: If the user cannot access the resource
(self)
| 45 | @has_access_api |
| 46 | @expose("/v1/query/", methods=["POST"]) |
| 47 | def query(self) -> FlaskResponse: # pylint: disable=no-self-use |
| 48 | """ |
| 49 | Takes a query_obj constructed in the client and returns payload data response |
| 50 | for the given query_obj. |
| 51 | |
| 52 | raises SupersetSecurityException: If the user cannot access the resource |
| 53 | """ |
| 54 | query_context = QueryContext(**json.loads(request.form["query_context"])) |
| 55 | query_context.raise_for_access() |
| 56 | result = query_context.get_payload() |
| 57 | payload_json = result["queries"] |
| 58 | return json.dumps( |
| 59 | payload_json, default=utils.json_int_dttm_ser, ignore_nan=True |
| 60 | ) |
| 61 | |
| 62 | @event_logger.log_this |
| 63 | @api |