Lee-W commented on code in PR #74451:
URL: https://github.com/apache/airflow/pull/74451#discussion_r4255549848
##########
providers/common/ai/src/airflow/providers/common/ai/hooks/pydantic_ai.py:
##########
@@ -873,11 +871,10 @@ def _get_provider_kwargs(
# "vertexai" predates pydantic-ai splitting GoogleProvider (Generative
Language API)
# from GoogleCloudProvider (Vertex AI, which hardcodes vertexai=True
internally and
# accepts no such constructor kwarg) in pydantic/pydantic-ai#5336.
Forwarding it would
- # raise TypeError, which the base hook's `except TypeError` in
get_conn() would then
- # catch: it logs a warning and falls back to env-var auth rather than
raising --
- # authenticating as the wrong identity (with *all* other kwargs
discarded). Accept
- # the field for backward compatibility but never forward it: which API
is used is
- # now controlled by the model prefix.
+ # raise TypeError, which the base hook's `except TypeError` in
get_conn() would turn
+ # into a ValueError rejecting the whole connection. Accept the field
for backward
Review Comment:
The `PydanticAIVertexHook` docstring and the Model field in
`pydantic_ai_vertex.rst` now say that `google:` on this connection type needs
`api_key` and no Vertex-only fields (`project`, `location`,
`service_account_info`). Left the forwarding logic as is.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]