robdiciuccio commented on a change in pull request #11499:
URL:
https://github.com/apache/incubator-superset/pull/11499#discussion_r540434922
##########
File path: superset/views/core.py
##########
@@ -484,6 +493,43 @@ def annotation_json( # pylint: disable=no-self-use
payload = viz_obj.get_payload()
return
data_payload_response(*viz_obj.payload_json_and_has_error(payload))
+ @event_logger.log_this
+ @api
+ @has_access_api
+ @handle_api_exception
+ @permission_name("explore_json")
+ @expose("/explore_json/data/<cache_key>", methods=["GET"])
+ @etag_cache(check_perms=check_explore_cache_perms)
+ def explore_json_data(self, cache_key: str) -> FlaskResponse:
+ """Serves cached result data for async explore_json calls
+
+ `self.generate_json` receives this input and returns different
+ payloads based on the request args in the first block
+
+ TODO: form_data should not be loaded twice from cache
+ (also loaded in `check_explore_cache_perms`)
+ """
+ try:
+ cached = cache_manager.cache.get(cache_key)
+ if not cached:
+ raise CacheLoadError("Cached data not found")
+
+ form_data = cached.get("form_data")
+ response_type = cached.get("response_type")
+
+ datasource_id, datasource_type = get_datasource_info(None, None,
form_data)
Review comment:
Yep
----------------------------------------------------------------
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]