fix: resolve MyPy type errors blocking CI

This commit is contained in:
Kristin Cowalcijk 2026-04-03 23:42:11 +08:00
parent 8914ec8ea5
commit 607a5d7d95
No known key found for this signature in database
GPG key ID: DB0876501620F27A
2 changed files with 3 additions and 2 deletions

View file

@ -118,7 +118,7 @@ def _generate_gcp_iam_access_token(service_account: str) -> str:
Access token string for GCP IAM authentication
"""
try:
from google.cloud import iam_credentials_v1
from google.cloud import iam_credentials_v1 # type: ignore
except ImportError:
raise ImportError(
"google-cloud-iam is required for GCP IAM Redis authentication. "

View file

@ -2,6 +2,7 @@ from typing import (
TYPE_CHECKING,
Any,
AsyncGenerator,
Dict,
List,
Literal,
Optional,
@ -757,7 +758,7 @@ class ModelArmorGuardrail(CustomGuardrail, VertexBase):
)
error_value = detail.get("error", detail)
if isinstance(error_value, dict):
error_obj = dict(error_value)
error_obj: Dict[str, Any] = dict(error_value)
else:
error_obj = {"message": str(error_value)}
error_obj["code"] = str(e.status_code)