fpopic commented on code in PR #53801:
URL: https://github.com/apache/airflow/pull/53801#discussion_r3066236316


##########
providers/hashicorp/src/airflow/providers/hashicorp/_internal_client/vault_client.py:
##########
@@ -352,25 +348,38 @@ def _auth_gcp(self, _client: hvac.Client) -> None:
         import json
         import time
 
-        import googleapiclient
+        # Determine service account email
+        service_account_email = getattr(credentials, "service_account_email", 
None)
+        if not service_account_email or not isinstance(service_account_email, 
str):
+            service_account_email = getattr(credentials, "client_email", None)
+
+        if not service_account_email or not isinstance(service_account_email, 
str):

Review Comment:
   I've updated the logic to use `if service_account_email is None:` for the 
fallback check. This ensures that if a value is explicitly provided but is of 
the wrong type, we don't silently fall back to instance discovery, which 
addresses your concern about unexpected behavior. I've also improved the error 
message to include the actual type received to make debugging easier.



-- 
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]

Reply via email to