jfrag1 commented on code in PR #23853:
URL: https://github.com/apache/superset/pull/23853#discussion_r1186366253
##########
superset/cachekeys/api.py:
##########
@@ -40,10 +42,98 @@ class CacheRestApi(BaseSupersetModelRestApi):
class_permission_name = "CacheRestApi"
include_route_methods = {
"invalidate",
+ "warm_up_cache",
}
openapi_spec_component_schemas = (CacheInvalidationRequestSchema,)
+ @expose("/warm_up_cache", methods=["GET"])
Review Comment:
moved to `PUT` and query parameters to json body payload validated by
marshmallow
##########
superset/cachekeys/api.py:
##########
@@ -40,10 +42,98 @@ class CacheRestApi(BaseSupersetModelRestApi):
class_permission_name = "CacheRestApi"
include_route_methods = {
"invalidate",
+ "warm_up_cache",
}
openapi_spec_component_schemas = (CacheInvalidationRequestSchema,)
+ @expose("/warm_up_cache", methods=["GET"])
+ @protect()
+ @safe
+ @statsd_metrics
+ @event_logger.log_this_with_context(
+ action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
+ f".warm_up_cache",
+ log_to_statsd=False,
+ )
+ def warm_up_cache(self) -> Response:
+ """Warms up the cache for the slice or table.
+
+ Note for slices a force refresh occurs.
+
+ In terms of the `extra_filters` these can be obtained from records in
the JSON
+ encoded `logs.json` column associated with the `explore_json` action.
+
+ ---
+ get:
+ description: >-
Review Comment:
done
--
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]