From 2e9d07780c08538371c00b5355b09397e76853b6 Mon Sep 17 00:00:00 2001 From: Ulada Zakharava Date: Tue, 29 Oct 2024 12:16:22 +0000 Subject: [PATCH] Update version of Google ADS --- generated/provider_dependencies.json | 2 +- .../src/airflow/providers/google/ads/hooks/ads.py | 12 +++++------- providers/src/airflow/providers/google/provider.yaml | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json index dc7aedc3b980..70240e37f70d 100644 --- a/generated/provider_dependencies.json +++ b/generated/provider_dependencies.json @@ -634,7 +634,7 @@ "gcloud-aio-bigquery>=6.1.2", "gcloud-aio-storage>=9.0.0", "gcsfs>=2023.10.0", - "google-ads>=25.0.0", + "google-ads>=25.1.0", "google-analytics-admin>=0.9.0", "google-api-core>=2.11.0,!=2.16.0,!=2.18.0", "google-api-python-client>=2.0.2", diff --git a/providers/src/airflow/providers/google/ads/hooks/ads.py b/providers/src/airflow/providers/google/ads/hooks/ads.py index 992993f47c60..20a40e34ca5d 100644 --- a/providers/src/airflow/providers/google/ads/hooks/ads.py +++ b/providers/src/airflow/providers/google/ads/hooks/ads.py @@ -32,9 +32,9 @@ from airflow.providers.google.common.hooks.base_google import get_field if TYPE_CHECKING: - from google.ads.googleads.v17.services.services.customer_service import CustomerServiceClient - from google.ads.googleads.v17.services.services.google_ads_service import GoogleAdsServiceClient - from google.ads.googleads.v17.services.types.google_ads_service import GoogleAdsRow + from google.ads.googleads.v18.services.services.customer_service import CustomerServiceClient + from google.ads.googleads.v18.services.services.google_ads_service import GoogleAdsServiceClient + from google.ads.googleads.v18.services.types.google_ads_service import GoogleAdsRow from google.api_core.page_iterator import GRPCIterator @@ -101,16 +101,14 @@ class GoogleAdsHook(BaseHook): :param api_version: The Google Ads API version to use. """ - default_api_version = "v17" - def __init__( self, - api_version: str | None, + api_version: str | None = None, gcp_conn_id: str = "google_cloud_default", google_ads_conn_id: str = "google_ads_default", ) -> None: super().__init__() - self.api_version = api_version or self.default_api_version + self.api_version = api_version self.gcp_conn_id = gcp_conn_id self.google_ads_conn_id = google_ads_conn_id self.google_ads_config: dict[str, Any] = {} diff --git a/providers/src/airflow/providers/google/provider.yaml b/providers/src/airflow/providers/google/provider.yaml index 508d54031826..1790008b3a33 100644 --- a/providers/src/airflow/providers/google/provider.yaml +++ b/providers/src/airflow/providers/google/provider.yaml @@ -106,7 +106,7 @@ dependencies: - gcloud-aio-bigquery>=6.1.2 - gcloud-aio-storage>=9.0.0 - gcsfs>=2023.10.0 - - google-ads>=25.0.0 + - google-ads>=25.1.0 - google-analytics-admin>=0.9.0 # Google-api-core 2.16.0 back-compat issue: # - https://github.com/googleapis/python-api-core/issues/576