betodealmeida commented on code in PR #28317:
URL: https://github.com/apache/superset/pull/28317#discussion_r1587503194


##########
superset/utils/cache.py:
##########
@@ -119,7 +119,11 @@ def sum(a: int, b: int) -> int:
 
     def wrap(f: Callable[..., Any]) -> Callable[..., Any]:
         def wrapped_f(*args: Any, **kwargs: Any) -> Any:
-            if not kwargs.get("cache", True):
+            should_cache = kwargs.pop("cache", True)
+            force = kwargs.pop("force", False)
+            cache_timeout = kwargs.pop("cache_timeout", 0)

Review Comment:
   The current way `memoized_func` works is that the decorated function needs 
to take these parameters, even though they are only used by the decorator. This 
makes the function tightly coupled with the decorator, which is bad design.
   
   I've fixed the decorator to pop these attributes, and removed them from the 
decorated functions.



-- 
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]

Reply via email to