fix vtx linting

This commit is contained in:
Ishaan Jaff 2025-07-18 18:45:13 -07:00
parent 85184c7f82
commit c89fad06e0

View file

@ -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}"