From c89fad06e0b1404169867e29e79e1f2929a8f279 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 18 Jul 2025 18:45:13 -0700 Subject: [PATCH] fix vtx linting --- litellm/llms/vertex_ai/vertex_llm_base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litellm/llms/vertex_ai/vertex_llm_base.py b/litellm/llms/vertex_ai/vertex_llm_base.py index f50a1d236e5..ae43e1fd167 100644 --- a/litellm/llms/vertex_ai/vertex_llm_base.py +++ b/litellm/llms/vertex_ai/vertex_llm_base.py @@ -36,7 +36,7 @@ class VertexBase: self._credentials: Optional[GoogleCredentialsObject] = None self._credentials_project_mapping: Dict[ Tuple[Optional[VERTEX_CREDENTIALS_TYPES], Optional[str]], - GoogleCredentialsObject, + Tuple[GoogleCredentialsObject, str], ] = {} self.project_id: Optional[str] = None self.async_handler: Optional[AsyncHTTPHandler] = None @@ -464,6 +464,10 @@ class VertexBase: credential_project_id, ) + # Check if credentials are None before accessing attributes + if _credentials is None: + raise ValueError("Credentials are None after loading") + if _credentials.expired: verbose_logger.debug( f"Credentials expired, refreshing for project_id: {project_id}"