From 40fc86e8dee808568d2daf5709b9689784fed372 Mon Sep 17 00:00:00 2001 From: sanix-darker Date: Thu, 21 Sep 2023 15:14:11 +0200 Subject: [PATCH] fix: some typos on .md and in comments doc: updaete on the doc doc: add those details to the CHANGELOG --- CHANGELOG.md | 7 +++++++ doc/connectors/google_big_query.md | 4 ++-- tests/google_big_query/test_google_big_query.py | 2 +- .../google_big_query/google_big_query_connector.py | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a74de766..667458cdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +## Fixed + +- Goole Big Query: + - fix Validation error when all GoogleCredentials are not set (only the `project_id` is required). + - Explicit error information when no data to return. + - fallback on normal GoogleCredentials connexion mode when jwt-token is not valid aymore. + ### [4.9.0] 2023-09-20 ## Changed diff --git a/doc/connectors/google_big_query.md b/doc/connectors/google_big_query.md index f632c1b9d..288c7266f 100644 --- a/doc/connectors/google_big_query.md +++ b/doc/connectors/google_big_query.md @@ -15,8 +15,8 @@ For authentication, download an authentication file from console.developper.com and use the values here. This is an oauth2 credential file. For more information see this: http://gspread.readthedocs.io/en/latest/oauth2.html -* `type`: str -* `project_id`: str +* `type`: str, required +* `project_id`: str, required * `private_key_id`: str * `private_key`: str * `client_email`: str diff --git a/tests/google_big_query/test_google_big_query.py b/tests/google_big_query/test_google_big_query.py index d7cbb108b..660b4be14 100644 --- a/tests/google_big_query/test_google_big_query.py +++ b/tests/google_big_query/test_google_big_query.py @@ -826,7 +826,7 @@ def test_optional_fields_validator_for_google_creds(): incomplete_credentials_with_no_project_id = { 'type': 'service_account', } - # should raise an errro if the project_id is not set + # should raise an error if the project_id is not set with pytest.raises(ValidationError) as _: _ = GoogleBigQueryConnector( name='something', credentials=incomplete_credentials_with_no_project_id diff --git a/toucan_connectors/google_big_query/google_big_query_connector.py b/toucan_connectors/google_big_query/google_big_query_connector.py index efe197673..02ba9d938 100644 --- a/toucan_connectors/google_big_query/google_big_query_connector.py +++ b/toucan_connectors/google_big_query/google_big_query_connector.py @@ -320,7 +320,7 @@ def _bigquery_variable_transformer(variable: str): """Add surrounding for parameters injection""" return f'@{variable}' - def _bigquery_client_with_google_creds(self): + def _bigquery_client_with_google_creds(self) -> bigquery.Client: try: credentials = GoogleBigQueryConnector._get_google_credentials( self.credentials, self.scopes