mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
chore: Embrace the walrus operator (#24127)
This commit is contained in:
@@ -121,8 +121,7 @@ class BaseScreenshot:
|
||||
@staticmethod
|
||||
def get_from_cache_key(cache: Cache, cache_key: str) -> Optional[BytesIO]:
|
||||
logger.info("Attempting to get from cache: %s", cache_key)
|
||||
payload = cache.get(cache_key)
|
||||
if payload:
|
||||
if payload := cache.get(cache_key):
|
||||
return BytesIO(payload)
|
||||
logger.info("Failed at getting from cache: %s", cache_key)
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user