keze commented on a change in pull request #19164:
URL: https://github.com/apache/airflow/pull/19164#discussion_r735899996
##########
File path: airflow/providers/google/cloud/utils/credentials_provider.py
##########
@@ -202,20 +204,22 @@ def __init__(
self,
key_path: Optional[str] = None,
keyfile_dict: Optional[Dict[str, str]] = None,
+ key_secret_name: Optional[str] = None,
scopes: Optional[Collection[str]] = None,
delegate_to: Optional[str] = None,
disable_logging: bool = False,
target_principal: Optional[str] = None,
delegates: Optional[Sequence[str]] = None,
) -> None:
super().__init__()
- if key_path and keyfile_dict:
- raise AirflowException(
- "The `keyfile_dict` and `key_path` fields are mutually
exclusive. "
- "Please provide only one value."
+ key_options = [key_path, key_secret_name, keyfile_dict]
+ if len([x for x in key_options if x]) > 1:
+ raise AirflowException(f"The `keyfile_dict`, `key_path`, and
`key_secret_name` fields"
+ "are all mutually exclusive. Please provide only one value."
)
Review comment:
No I didn't mean that. If two vars have some value it wouldn't throw
exception and it should, because they are mutually exclusive. (e.g there can
not be key_path and key_secret_name set, but in your case with XORs would be
false and wouldn't throw exception)
--
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]