From 01ef8322270e55c4e4a9a416d435114f578f7cc2 Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Wed, 3 May 2023 12:01:03 -0700 Subject: [PATCH] fix: timeout should be an integer --- superset/utils/cache.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/superset/utils/cache.py b/superset/utils/cache.py index 442690b26c3e..a632b04b374a 100644 --- a/superset/utils/cache.py +++ b/superset/utils/cache.py @@ -95,8 +95,7 @@ def view_cache_key(*args: Any, **kwargs: Any) -> str: # pylint: disable=unused- def memoized_func( - key: Optional[str] = None, - cache: Cache = cache_manager.cache, + key: Optional[str] = None, cache: Cache = cache_manager.cache ) -> Callable[..., Any]: """ Decorator with configurable key and cache backend. @@ -143,7 +142,7 @@ def wrapped_f(*args: Any, **kwargs: Any) -> Any: if not kwargs.get("force") and obj is not None: return obj obj = f(*args, **kwargs) - cache.set(cache_key, obj, timeout=kwargs.get("cache_timeout")) + cache.set(cache_key, obj, timeout=kwargs.get("cache_timeout", 0)) return obj return wrapped_f