Skip to content

Commit 8497476

Browse files
yeesiancopybara-github
authored andcommitted
fix: Catch runtime errors in the import of TypeAliasType from typing_extensions
PiperOrigin-RevId: 712610767
1 parent f5ddbb8 commit 8497476

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vertexai/generative_models/_generative_models.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@
129129
],
130130
],
131131
)
132-
except ImportError:
132+
except (ImportError, RuntimeError) as e:
133+
from google.cloud.aiplatform import base
134+
135+
_LOGGER = base.Logger(__name__)
136+
_LOGGER.debug(f"Failed to import typing_extensions.TypeAliasType: {e}")
133137
# Use existing definitions if typing_extensions is not available.
134138
PartsType = Union[
135139
str,

0 commit comments

Comments
 (0)