From e64b3b8c21431b561790a4e185d73be00d2f6c31 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Mon, 4 May 2026 22:14:24 +0530 Subject: [PATCH] Fix mypy --- litellm/llms/vertex_ai/vertex_llm_base.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/litellm/llms/vertex_ai/vertex_llm_base.py b/litellm/llms/vertex_ai/vertex_llm_base.py index d5516a38785..ab193406aba 100644 --- a/litellm/llms/vertex_ai/vertex_llm_base.py +++ b/litellm/llms/vertex_ai/vertex_llm_base.py @@ -969,11 +969,14 @@ class VertexBase: # Clean up the entry automatically when the task finishes so # that long-running proxies with many credential keys do not # accumulate stale references. - task.add_done_callback( - lambda t, key=credential_cache_key: self._background_refresh_tasks.pop( - key, None + def _drop_background_refresh_task( + _fut: asyncio.Future[Any], + ) -> None: + self._background_refresh_tasks.pop( + credential_cache_key, None ) - ) + + task.add_done_callback(_drop_background_refresh_task) self._background_refresh_tasks[credential_cache_key] = task return current_token, resolved_project