From ad19cd9fbd1dd91f27b6871dff0e95453c3c97c7 Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Wed, 3 May 2023 13:33:00 -0700 Subject: [PATCH] fix: timeout should be an integer (#23924) --- 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 442690b26..a632b04b3 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 memoized_func( 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