From 693f26f0f570277b9c7e57da38e9274c2c7f323c Mon Sep 17 00:00:00 2001 From: Artem Inzhyyants <36314070+artem1205@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:30:50 +0200 Subject: [PATCH] Source Google Ads: optimize check method (#36891) Signed-off-by: Artem Inzhyyants --- .../connectors/source-google-ads/metadata.yaml | 2 +- .../connectors/source-google-ads/pyproject.toml | 2 +- .../connectors/source-google-ads/source_google_ads/source.py | 5 +++-- docs/integrations/sources/google-ads.md | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-google-ads/metadata.yaml b/airbyte-integrations/connectors/source-google-ads/metadata.yaml index 6224b0c1709f..0050a81006d3 100644 --- a/airbyte-integrations/connectors/source-google-ads/metadata.yaml +++ b/airbyte-integrations/connectors/source-google-ads/metadata.yaml @@ -11,7 +11,7 @@ data: connectorSubtype: api connectorType: source definitionId: 253487c0-2246-43ba-a21f-5116b20a2c50 - dockerImageTag: 3.4.0 + dockerImageTag: 3.4.1 dockerRepository: airbyte/source-google-ads documentationUrl: https://docs.airbyte.com/integrations/sources/google-ads githubIssueLabel: source-google-ads diff --git a/airbyte-integrations/connectors/source-google-ads/pyproject.toml b/airbyte-integrations/connectors/source-google-ads/pyproject.toml index 8f80d04f0f2f..e085def2d81f 100644 --- a/airbyte-integrations/connectors/source-google-ads/pyproject.toml +++ b/airbyte-integrations/connectors/source-google-ads/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "3.4.0" +version = "3.4.1" name = "source-google-ads" description = "Source implementation for Google Ads." authors = [ "Airbyte ",] 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 3eff39333d31..d82e7d691186 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 @@ -187,8 +187,8 @@ def check_connection(self, logger: logging.Logger, config: Mapping[str, Any]) -> logger.info(f"Found {len(customers)} customers: {[customer.id for customer in customers]}") # Check custom query request validity by sending metric request with non-existent time window - for customer in customers: - for query in config.get("custom_queries_array", []): + for query in config.get("custom_queries_array", []): + for customer in customers: table_name = query["table_name"] query = query["query"] if customer.is_manager_account and self.is_metrics_in_custom_query(query): @@ -215,6 +215,7 @@ def check_connection(self, logger: logging.Logger, config: Mapping[str, Any]) -> # iterate over the response otherwise exceptions will not be raised! for _ in response: pass + break return True, None def streams(self, config: Mapping[str, Any]) -> List[Stream]: diff --git a/docs/integrations/sources/google-ads.md b/docs/integrations/sources/google-ads.md index 2fe5a3b83edc..3dc596be5536 100644 --- a/docs/integrations/sources/google-ads.md +++ b/docs/integrations/sources/google-ads.md @@ -280,6 +280,7 @@ Due to a limitation in the Google Ads API which does not allow getting performan | Version | Date | Pull Request | Subject | |:---------|:-----------|:---------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------| +| `3.4.1` | 2024-04-08 | [36891](https://github.com/airbytehq/airbyte/pull/36891) | Optimize `check` method | | `3.4.0` | 2024-03-19 | [36267](https://github.com/airbytehq/airbyte/pull/36267) | Pin airbyte-cdk version to `^0` | | `3.3.7` | 2024-03-15 | [36208](https://github.com/airbytehq/airbyte/pull/36208) | Added error message when there is the `unrecognized field` inside of the `custom query` | | `3.3.6` | 2024-03-01 | [35664](https://github.com/airbytehq/airbyte/pull/35664) | Fix error for new customers for incremental events streams |