diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 5162e704cd06..358637c4b81d 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -266,7 +266,7 @@ - name: Google Ads sourceDefinitionId: 253487c0-2246-43ba-a21f-5116b20a2c50 dockerRepository: airbyte/source-google-ads - dockerImageTag: 0.1.31 + dockerImageTag: 0.1.32 documentationUrl: https://docs.airbyte.io/integrations/sources/google-ads icon: google-adwords.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 4cbbc03e2c94..4253c7b89ed0 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -2530,7 +2530,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-google-ads:0.1.31" +- dockerImage: "airbyte/source-google-ads:0.1.32" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/google-ads" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-google-ads/Dockerfile b/airbyte-integrations/connectors/source-google-ads/Dockerfile index 4a40dbdc7ff1..03cd274c9861 100644 --- a/airbyte-integrations/connectors/source-google-ads/Dockerfile +++ b/airbyte-integrations/connectors/source-google-ads/Dockerfile @@ -13,5 +13,5 @@ RUN pip install . ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=0.1.31 +LABEL io.airbyte.version=0.1.32 LABEL io.airbyte.name=airbyte/source-google-ads diff --git a/airbyte-integrations/connectors/source-google-ads/source_google_ads/source.py b/airbyte-integrations/connectors/source-google-ads/source_google_ads/source.py index 33e552c48db8..90d6f9409313 100644 --- a/airbyte-integrations/connectors/source-google-ads/source_google_ads/source.py +++ b/airbyte-integrations/connectors/source-google-ads/source_google_ads/source.py @@ -3,6 +3,7 @@ # +import traceback from typing import Any, List, Mapping, Tuple, Union from airbyte_cdk import AirbyteLogger @@ -96,16 +97,18 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> query = query.get("query") if is_manager_account and self.is_metrics_in_custom_query(query): - raise Exception(f"Metrics are not available for manager account. Check fields in your custom query: {query}") + return False, f"Metrics are not available for manager account. Check fields in your custom query: {query}" if CustomQuery.cursor_field in query: - raise Exception(f"Custom query should not contain {CustomQuery.cursor_field}") + return False, f"Custom query should not contain {CustomQuery.cursor_field}" req_q = CustomQuery.insert_segments_date_expr(query, "1980-01-01", "1980-01-01") for customer_id in google_api.customer_ids: google_api.send_request(req_q, customer_id=customer_id) return True, None - except GoogleAdsException as error: - return False, f"Unable to connect to Google Ads API with the provided credentials - {repr(error.failure)}" + except GoogleAdsException as exception: + error_messages = ", ".join([error.message for error in exception.failure.errors]) + logger.error(traceback.format_exc()) + return False, f"Unable to connect to Google Ads API with the provided credentials - {error_messages}" def streams(self, config: Mapping[str, Any]) -> List[Stream]: google_api = GoogleAds(credentials=self.get_credentials(config), customer_id=config["customer_id"]) diff --git a/docs/integrations/sources/google-ads.md b/docs/integrations/sources/google-ads.md index 14570b2f9f08..4cab2b9683a1 100644 --- a/docs/integrations/sources/google-ads.md +++ b/docs/integrations/sources/google-ads.md @@ -106,6 +106,7 @@ This source is constrained by whatever API limits are set for the Google Ads tha | Version | Date | Pull Request | Subject | |:---------|:-----------| :--- |:---------------------------------------------------------------------------------------------| +| `0.1.32` | 2022-03-24 | [11371](https://github.com/airbytehq/airbyte/pull/11371) | Improve how connection check returns error messages | | `0.1.31` | 2022-03-23 | [11301](https://github.com/airbytehq/airbyte/pull/11301) | Update docs and spec to clarify usage | | `0.1.30` | 2022-03-23 | [11221](https://github.com/airbytehq/airbyte/pull/11221) | Add `*_labels` streams to fetch the label text rather than their IDs | | `0.1.29` | 2022-03-22 | [10919](https://github.com/airbytehq/airbyte/pull/10919) | Fix user location report schema and add to acceptance tests |