From eaa6e4003a0d2e38be6161b412d7b8e3eb09f1fa Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 16 Dec 2024 13:17:09 +0530 Subject: [PATCH] fix: Don't cache anything hashable If filters are list or dict then they aren't hashable, there was little reason to do this IMO. If something is indeed cacheable then where is the eviction for it? simple k:v is only thing we can realistically cache here. --- frappe/database/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/database/database.py b/frappe/database/database.py index 91c187844d..e33394b98e 100644 --- a/frappe/database/database.py +++ b/frappe/database/database.py @@ -595,7 +595,7 @@ class Database: """ out = None cache_key = None - if cache and isinstance(filters, Hashable): + if cache and isinstance(filters, str): cache_key = (doctype, filters, fieldname) if cache_key in self.value_cache: return self.value_cache[cache_key]