michael-s-molina commented on code in PR #31844:
URL: https://github.com/apache/superset/pull/31844#discussion_r1924246474


##########
superset/config.py:
##########
@@ -689,17 +689,29 @@ class D3TimeFormat(TypedDict, total=False):
 # This is merely a default
 EXTRA_SEQUENTIAL_COLOR_SCHEMES: list[dict[str, Any]] = []
 
+# User used to execute cache warmup tasks
+# By default, the cache is warmed up using the primary owner. To fall back to 
using
+# a fixed user (admin in this example), use the following configuration:
+#
+# from superset.tasks.types import ExecutorType, FixedExecutor
+#
+# CACHE_WARMUP_EXECUTORS = [ExecutorType.OWNER, FixedExecutor("admin")]
+CACHE_WARMUP_EXECUTORS = [ExecutorType.OWNER]

Review Comment:
   Would a class with predefined values that can be extended be serializable 
enough? Something like:
   
   ```
   class AsyncTaskType:
      CACHE_WARMUP = "CACHE_WARMUP",
      ALERTS_REPORTS = "ALERTS_REPORTS",
   
      _additional_types = set()
   
      @classmethod
      def add_type(cls, type):
          if type not in cls._additional_types:
              cls._additional_types.add(type)
   
      @classmethod
      def get_types(cls):
          return {cls.CACHE_WARMUP, 
cls.ALERTS_REPORTS}.union(cls._additional_types)
   
   ```



-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to