feat: add option for hash algorithms (#35621)

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
Daniel Vaz Gaspar
2025-12-09 16:59:07 +00:00
committed by GitHub
parent 8d7c83419c
commit bb22eb1ca8
36 changed files with 1032 additions and 166 deletions

View File

@@ -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):