mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: enforce more ruff rules (#31447)
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
committed by
GitHub
parent
9da65d6bfd
commit
e51b95ffa8
@@ -115,7 +115,7 @@ def memoized_func(key: str, cache: Cache = cache_manager.cache) -> Callable[...,
|
||||
:param key: a callable function that takes function arguments and returns
|
||||
the caching key.
|
||||
:param cache: a FlaskCache instance that will store the cache.
|
||||
"""
|
||||
""" # noqa: E501
|
||||
|
||||
def wrap(f: Callable[..., Any]) -> Callable[..., Any]:
|
||||
def wrapped_f(*args: Any, **kwargs: Any) -> Any:
|
||||
@@ -144,7 +144,7 @@ def memoized_func(key: str, cache: Cache = cache_manager.cache) -> Callable[...,
|
||||
return wrap
|
||||
|
||||
|
||||
def etag_cache(
|
||||
def etag_cache( # noqa: C901
|
||||
cache: Cache = cache_manager.cache,
|
||||
get_last_modified: Callable[..., datetime] | None = None,
|
||||
max_age: int | float = app.config["CACHE_DEFAULT_TIMEOUT"],
|
||||
@@ -164,9 +164,9 @@ def etag_cache(
|
||||
|
||||
"""
|
||||
|
||||
def decorator(f: Callable[..., Any]) -> Callable[..., Any]:
|
||||
def decorator(f: Callable[..., Any]) -> Callable[..., Any]: # noqa: C901
|
||||
@wraps(f)
|
||||
def wrapper(*args: Any, **kwargs: Any) -> Response:
|
||||
def wrapper(*args: Any, **kwargs: Any) -> Response: # noqa: C901
|
||||
# Check if the user can access the resource
|
||||
if raise_for_access:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user