MCPcopy
hub / github.com/apache/superset / query

Method query

superset/views/api.py:47–60  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 15

refresh_druidFunction · 0.45
export_dashboardsFunction · 0.45
export_datasourcesFunction · 0.45
update_datasources_cacheFunction · 0.45
get_queryFunction · 0.45
get_dfMethod · 0.45
get_dataMethod · 0.45
bulk_deleteMethod · 0.45
has_annotationsMethod · 0.45
bulk_deleteMethod · 0.45

Calls 3

raise_for_accessMethod · 0.95
get_payloadMethod · 0.95
QueryContextClass · 0.90

Tested by 15

createTableMethod · 0.36
delete_importsMethod · 0.36
get_datasourceMethod · 0.36
get_clusterMethod · 0.36
checkMethod · 0.36
test_sync_druid_permMethod · 0.36
test_refresh_metadataMethod · 0.36
get_upload_dbFunction · 0.36
get_query_by_idFunction · 0.36