From 6f48e7a454ad8de329f8fd0325eec1cc06cba686 Mon Sep 17 00:00:00 2001 From: Baz Date: Fri, 21 Jun 2024 13:44:54 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Source=20Google=20Analytics=20(`?= =?UTF-8?q?Data=20API`,=20a.k.a=20`4=20(GA4)`=20)=20(#39916)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source-google-analytics-data-api/metadata.yaml | 2 +- .../source-google-analytics-data-api/pyproject.toml | 2 +- .../source_google_analytics_data_api/source.py | 11 ++++++++++- .../integrations/sources/google-analytics-data-api.md | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/airbyte-integrations/connectors/source-google-analytics-data-api/metadata.yaml b/airbyte-integrations/connectors/source-google-analytics-data-api/metadata.yaml index a825a01f36bb..375a5511f29d 100644 --- a/airbyte-integrations/connectors/source-google-analytics-data-api/metadata.yaml +++ b/airbyte-integrations/connectors/source-google-analytics-data-api/metadata.yaml @@ -12,7 +12,7 @@ data: connectorSubtype: api connectorType: source definitionId: 3cc2eafd-84aa-4dca-93af-322d9dfeec1a - dockerImageTag: 2.4.5 + dockerImageTag: 2.4.6 dockerRepository: airbyte/source-google-analytics-data-api documentationUrl: https://docs.airbyte.com/integrations/sources/google-analytics-data-api githubIssueLabel: source-google-analytics-data-api diff --git a/airbyte-integrations/connectors/source-google-analytics-data-api/pyproject.toml b/airbyte-integrations/connectors/source-google-analytics-data-api/pyproject.toml index 1a00c282cb33..54e3a48c4e06 100644 --- a/airbyte-integrations/connectors/source-google-analytics-data-api/pyproject.toml +++ b/airbyte-integrations/connectors/source-google-analytics-data-api/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "2.4.5" +version = "2.4.6" name = "source-google-analytics-data-api" description = "Source implementation for Google Analytics Data Api." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-google-analytics-data-api/source_google_analytics_data_api/source.py b/airbyte-integrations/connectors/source-google-analytics-data-api/source_google_analytics_data_api/source.py index eb07d6fadd31..6404b2405b1c 100644 --- a/airbyte-integrations/connectors/source-google-analytics-data-api/source_google_analytics_data_api/source.py +++ b/airbyte-integrations/connectors/source-google-analytics-data-api/source_google_analytics_data_api/source.py @@ -438,6 +438,13 @@ def default_date_ranges_start_date(self) -> str: # set default date ranges start date to 2 years ago return pendulum.now(tz="UTC").subtract(years=2).format("YYYY-MM-DD") + @property + def raise_exception_on_missing_stream(self) -> bool: + # reference issue: https://github.com/airbytehq/airbyte-internal-issues/issues/8315 + # This has been added, because there is a risk of removing the `Custom Stream` from the `input configuration`, + # which brings the error about `missing stream` present in the CATALOG but not in the `input configuration`. + return False + def _validate_and_transform_start_date(self, start_date: str) -> datetime.date: start_date = self.default_date_ranges_start_date if not start_date else start_date @@ -568,7 +575,9 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]: config["authenticator"] = self.get_authenticator(config) return [stream for report in reports + config["custom_reports_array"] for stream in self.instantiate_report_streams(report, config)] - def instantiate_report_streams(self, report: dict, config: Mapping[str, Any], **extra_kwargs) -> GoogleAnalyticsDataApiBaseStream: + def instantiate_report_streams( + self, report: dict, config: Mapping[str, Any], **extra_kwargs + ) -> Iterable[GoogleAnalyticsDataApiBaseStream]: add_name_suffix = False for property_id in config["property_ids"]: yield self.instantiate_report_class( diff --git a/docs/integrations/sources/google-analytics-data-api.md b/docs/integrations/sources/google-analytics-data-api.md index 2b1ab11fb30a..49581ff18e14 100644 --- a/docs/integrations/sources/google-analytics-data-api.md +++ b/docs/integrations/sources/google-analytics-data-api.md @@ -268,6 +268,7 @@ The Google Analytics connector is subject to Google Analytics Data API quotas. P | Version | Date | Pull Request | Subject | |:--------|:-----------| :------------------------------------------------------- |:---------------------------------------------------------------------------------------| +| 2.4.6 | 2024-06-21 | [39916](https://github.com/airbytehq/airbyte/pull/39916) | Added ability to skip `missing stream` in the CATALOG | | 2.4.5 | 2024-06-06 | [38884](https://github.com/airbytehq/airbyte/pull/38884) | Make lookback window configurable. | | 2.4.4 | 2024-06-06 | [39209](https://github.com/airbytehq/airbyte/pull/39209) | [autopull] Upgrade base image to v1.2.2 | | 2.4.3 | 2024-06-03 | [38865](https://github.com/airbytehq/airbyte/pull/38865) | Enforce unique property IDs |