updates method to get value dict from cache

This commit is contained in:
Mose Müller 2023-12-04 08:33:40 +01:00
parent 06e642972f
commit 53713794d6

View File

@ -32,8 +32,8 @@ class DataServiceCache:
def update_cache(self, full_access_path: str, value: Any) -> None: def update_cache(self, full_access_path: str, value: Any) -> None:
set_nested_value_by_path(self._cache, full_access_path, value) set_nested_value_by_path(self._cache, full_access_path, value)
def get_value_dict_from_cache(self, full_access_path: str) -> dict[str, Any] | None: def get_value_dict_from_cache(self, full_access_path: str) -> dict[str, Any]:
try: try:
return get_nested_dict_by_path(self._cache, full_access_path) return get_nested_dict_by_path(self._cache, full_access_path)
except (SerializationPathError, SerializationValueError, KeyError): except (SerializationPathError, SerializationValueError, KeyError):
return None return {}