Skip to content

Commit e635a98

Browse files
feat(source-google-ads): api update (#44095)
Co-authored-by: Alexandre Girard <[email protected]>
1 parent ee1e940 commit e635a98

File tree

11 files changed

+328
-172
lines changed

11 files changed

+328
-172
lines changed

airbyte-integrations/connectors/source-google-ads/integration_tests/integration_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import pytest
99
from airbyte_cdk.models import SyncMode
10-
from google.ads.googleads.v15.services.types.google_ads_service import GoogleAdsRow
10+
from google.ads.googleads.v17.services.types.google_ads_service import GoogleAdsRow
1111
from source_google_ads.source import SourceGoogleAds
1212

1313

airbyte-integrations/connectors/source-google-ads/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data:
1111
connectorSubtype: api
1212
connectorType: source
1313
definitionId: 253487c0-2246-43ba-a21f-5116b20a2c50
14-
dockerImageTag: 3.6.5
14+
dockerImageTag: 3.7.0
1515
dockerRepository: airbyte/source-google-ads
1616
documentationUrl: https://docs.airbyte.com/integrations/sources/google-ads
1717
githubIssueLabel: source-google-ads

airbyte-integrations/connectors/source-google-ads/poetry.lock

+179-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-integrations/connectors/source-google-ads/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
33
build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
6-
version = "3.6.5"
6+
version = "3.7.0"
77
name = "source-google-ads"
88
description = "Source implementation for Google Ads."
99
authors = [ "Airbyte <[email protected]>",]
@@ -17,7 +17,7 @@ include = "source_google_ads"
1717

1818
[tool.poetry.dependencies]
1919
python = "^3.10,<3.12"
20-
google-ads = "==22.1.0"
20+
google-ads = "==25.0.0"
2121
protobuf = "==4.25.2"
2222
airbyte-cdk = "^4"
2323

airbyte-integrations/connectors/source-google-ads/source_google_ads/google_ads.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
from airbyte_cdk.models import FailureType
1111
from airbyte_cdk.utils import AirbyteTracedException
1212
from google.ads.googleads.client import GoogleAdsClient
13-
from google.ads.googleads.v15.services.types.google_ads_service import GoogleAdsRow, SearchGoogleAdsResponse
13+
from google.ads.googleads.v17.services.types.google_ads_service import GoogleAdsRow, SearchGoogleAdsResponse
1414
from google.api_core.exceptions import InternalServerError, ServerError, TooManyRequests
1515
from google.auth import exceptions
1616
from proto.marshal.collections import Repeated, RepeatedComposite
1717

1818
from .utils import logger
1919

20-
API_VERSION = "v15"
20+
API_VERSION = "v17"
2121

2222

2323
def on_give_up(details):
@@ -94,7 +94,6 @@ def send_request(
9494
client = self.get_client(login_customer_id)
9595
search_request = client.get_type("SearchGoogleAdsRequest")
9696
search_request.query = query
97-
search_request.page_size = self.DEFAULT_PAGE_SIZE
9897
search_request.customer_id = customer_id
9998
return [self.ga_service(login_customer_id).search(search_request)]
10099

airbyte-integrations/connectors/source-google-ads/source_google_ads/streams.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from airbyte_cdk.utils import AirbyteTracedException
1515
from airbyte_protocol.models import FailureType
1616
from google.ads.googleads.errors import GoogleAdsException
17-
from google.ads.googleads.v15.services.services.google_ads_service.pagers import SearchPager
18-
from google.ads.googleads.v15.services.types.google_ads_service import SearchGoogleAdsResponse
17+
from google.ads.googleads.v17.services.services.google_ads_service.pagers import SearchPager
18+
from google.ads.googleads.v17.services.types.google_ads_service import SearchGoogleAdsResponse
1919
from google.api_core.exceptions import InternalServerError, ServerError, ServiceUnavailable, TooManyRequests, Unauthenticated
2020

2121
from .google_ads import GoogleAds, logger

airbyte-integrations/connectors/source-google-ads/source_google_ads/utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
from airbyte_cdk.models import FailureType
1717
from airbyte_cdk.utils import AirbyteTracedException
1818
from google.ads.googleads.errors import GoogleAdsException
19-
from google.ads.googleads.v15.errors.types.authentication_error import AuthenticationErrorEnum
20-
from google.ads.googleads.v15.errors.types.authorization_error import AuthorizationErrorEnum
21-
from google.ads.googleads.v15.errors.types.query_error import QueryErrorEnum
22-
from google.ads.googleads.v15.errors.types.quota_error import QuotaErrorEnum
23-
from google.ads.googleads.v15.errors.types.request_error import RequestErrorEnum
19+
from google.ads.googleads.v17.errors.types.authentication_error import AuthenticationErrorEnum
20+
from google.ads.googleads.v17.errors.types.authorization_error import AuthorizationErrorEnum
21+
from google.ads.googleads.v17.errors.types.query_error import QueryErrorEnum
22+
from google.ads.googleads.v17.errors.types.quota_error import QuotaErrorEnum
23+
from google.ads.googleads.v17.errors.types.request_error import RequestErrorEnum
2424
from google.api_core.exceptions import Unauthenticated
2525

2626
logger = logging.getLogger("airbyte")

airbyte-integrations/connectors/source-google-ads/unit_tests/common.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import json
77

88
from google.ads.googleads.errors import GoogleAdsException
9-
from google.ads.googleads.v15 import GoogleAdsFailure
10-
from google.ads.googleads.v15.errors.types.authentication_error import AuthenticationErrorEnum
11-
from google.ads.googleads.v15.errors.types.authorization_error import AuthorizationErrorEnum
12-
from google.ads.googleads.v15.errors.types.query_error import QueryErrorEnum
13-
from google.ads.googleads.v15.errors.types.quota_error import QuotaErrorEnum
9+
from google.ads.googleads.v17 import GoogleAdsFailure
10+
from google.ads.googleads.v17.errors.types.authentication_error import AuthenticationErrorEnum
11+
from google.ads.googleads.v17.errors.types.authorization_error import AuthorizationErrorEnum
12+
from google.ads.googleads.v17.errors.types.query_error import QueryErrorEnum
13+
from google.ads.googleads.v17.errors.types.quota_error import QuotaErrorEnum
1414

1515

1616
class MockSearchRequest:

airbyte-integrations/connectors/source-google-ads/unit_tests/test_google_ads.py

-2
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,11 @@ def test_send_request(mocker, customers):
7171
mocker.patch("source_google_ads.google_ads.GoogleAdsClient.get_service", return_value=MockGoogleAdsService())
7272
google_ads_client = GoogleAds(**SAMPLE_CONFIG)
7373
query = "Query"
74-
page_size = 1000
7574
customer_id = next(iter(customers)).id
7675
response = list(google_ads_client.send_request(query, customer_id=customer_id))
7776

7877
assert response[0].customer_id == customer_id
7978
assert response[0].query == query
80-
assert response[0].page_size == page_size
8179

8280

8381
def test_get_fields_from_schema():

airbyte-integrations/connectors/source-google-ads/unit_tests/test_streams.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from airbyte_cdk.models import FailureType, SyncMode
1010
from airbyte_cdk.utils import AirbyteTracedException
1111
from google.ads.googleads.errors import GoogleAdsException
12-
from google.ads.googleads.v15.errors.types.errors import ErrorCode, GoogleAdsError, GoogleAdsFailure
13-
from google.ads.googleads.v15.errors.types.request_error import RequestErrorEnum
12+
from google.ads.googleads.v17.errors.types.errors import ErrorCode, GoogleAdsError, GoogleAdsFailure
13+
from google.ads.googleads.v17.errors.types.request_error import RequestErrorEnum
1414
from google.api_core.exceptions import DataLoss, InternalServerError, ResourceExhausted, TooManyRequests, Unauthenticated
1515
from grpc import RpcError
1616
from source_google_ads.google_ads import GoogleAds

0 commit comments

Comments
 (0)