diff --git a/airflow/providers/google/cloud/_internal_client/secret_manager_client.py b/airflow/providers/google/cloud/_internal_client/secret_manager_client.py index 4a6fe127cc360..9ea72e63bbba9 100644 --- a/airflow/providers/google/cloud/_internal_client/secret_manager_client.py +++ b/airflow/providers/google/cloud/_internal_client/secret_manager_client.py @@ -75,7 +75,7 @@ def get_secret(self, secret_id: str, project_id: str, secret_version: str = "lat value = response.payload.data.decode("UTF-8") return value except NotFound: - self.log.error("Google Cloud API Call Error (NotFound): Secret ID %s not found.", secret_id) + self.log.debug("Google Cloud API Call Error (NotFound): Secret ID %s not found.", secret_id) return None except PermissionDenied: self.log.error( diff --git a/tests/providers/google/cloud/secrets/test_secret_manager.py b/tests/providers/google/cloud/secrets/test_secret_manager.py index edba0c4cf0282..710a575078fc9 100644 --- a/tests/providers/google/cloud/secrets/test_secret_manager.py +++ b/tests/providers/google/cloud/secrets/test_secret_manager.py @@ -127,7 +127,7 @@ def test_get_conn_uri_non_existent_key(self, mock_client_callable, mock_get_cred secrets_manager_backend = CloudSecretManagerBackend(connections_prefix=CONNECTIONS_PREFIX) secret_id = secrets_manager_backend.build_path(CONNECTIONS_PREFIX, CONN_ID, SEP) - with self.assertLogs(secrets_manager_backend.client.log, level="ERROR") as log_output: + with self.assertLogs(secrets_manager_backend.client.log, level="DEBUG") as log_output: assert secrets_manager_backend.get_conn_uri(conn_id=CONN_ID) is None assert secrets_manager_backend.get_connection(conn_id=CONN_ID) is None assert re.search( @@ -202,7 +202,7 @@ def test_get_variable_non_existent_key(self, mock_client_callable, mock_get_cred secrets_manager_backend = CloudSecretManagerBackend(variables_prefix=VARIABLES_PREFIX) secret_id = secrets_manager_backend.build_path(VARIABLES_PREFIX, VAR_KEY, SEP) - with self.assertLogs(secrets_manager_backend.client.log, level="ERROR") as log_output: + with self.assertLogs(secrets_manager_backend.client.log, level="DEBUG") as log_output: assert secrets_manager_backend.get_variable(VAR_KEY) is None assert re.search( f"Google Cloud API Call Error \\(NotFound\\): Secret ID {secret_id} not found",