From 3f522a824625fd3ae5f3decedee3cabaa6100c5c Mon Sep 17 00:00:00 2001 From: Taisir Hassan Date: Tue, 19 May 2026 07:02:20 -0700 Subject: [PATCH] Remove duplicate pop in InMemoryCacheProvider.remove (#5795) The second self._cache.pop(key, None) call is a guaranteed no-op: the first pop has already removed the key (or returned None), and there is no await between the two statements that could allow another coroutine to re-add it. Removing the dead line clarifies intent without changing behavior. --- python/packages/purview/agent_framework_purview/_cache.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/packages/purview/agent_framework_purview/_cache.py b/python/packages/purview/agent_framework_purview/_cache.py index d559895a63..df5d03b97e 100644 --- a/python/packages/purview/agent_framework_purview/_cache.py +++ b/python/packages/purview/agent_framework_purview/_cache.py @@ -161,7 +161,6 @@ class InMemoryCacheProvider: entry = self._cache.pop(key, None) if entry is not None: self._current_size_bytes -= entry[2] - self._cache.pop(key, None) def create_protection_scopes_cache_key(request: ProtectionScopesRequest) -> str: