def generate_cache_key(func: object, *args, **kwargs) -> str:
# Todo: Why are the args all over the map
# hashable_args = tuple([convert_to_hashable_str(arg) for arg in args])
hashable_kwargs = tuple(
sorted(
(key, convert_to_hashable_str(value)) for key, value in kwargs.items()
)
)
hashable_tuple = (
func.__module__,
func.__qualname__,
# Todo: Why are the args all over the map
# hashable_args,
hashable_kwargs,
)
hash_key = hashlib.sha256(
str(hashable_tuple).encode()
).hexdigest()
return hash_key