mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: add option for hash algorithms (#35621)
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8d7c83419c
commit
bb22eb1ca8
@@ -31,14 +31,14 @@ from superset import db
|
||||
from superset.constants import CACHE_DISABLED_TIMEOUT
|
||||
from superset.extensions import cache_manager
|
||||
from superset.models.cache import CacheKey
|
||||
from superset.utils.hashing import md5_sha_from_dict
|
||||
from superset.utils.hashing import hash_from_dict
|
||||
from superset.utils.json import json_int_dttm_ser
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def generate_cache_key(values_dict: dict[str, Any], key_prefix: str = "") -> str:
|
||||
hash_str = md5_sha_from_dict(values_dict, default=json_int_dttm_ser)
|
||||
hash_str = hash_from_dict(values_dict, default=json_int_dttm_ser)
|
||||
cache_key = f"{key_prefix}{hash_str}"
|
||||
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
|
||||
Reference in New Issue
Block a user