Skip to content

Commit e54c2cf

Browse files
authored
🐛 Source Google Ads: add retry to handle InternalServerError for grpc internal lib (#32001)
Co-authored-by: bazarnov <[email protected]>
1 parent 050f7de commit e54c2cf

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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: 2.0.1
14+
dockerImageTag: 2.0.2
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/source_google_ads/google_ads.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from airbyte_cdk.utils import AirbyteTracedException
1313
from google.ads.googleads.client import GoogleAdsClient
1414
from google.ads.googleads.v13.services.types.google_ads_service import GoogleAdsRow, SearchGoogleAdsResponse
15-
from google.api_core.exceptions import ServerError, TooManyRequests
15+
from google.api_core.exceptions import InternalServerError, ServerError, TooManyRequests
1616
from google.auth import exceptions
1717
from proto.marshal.collections import Repeated, RepeatedComposite
1818

@@ -40,7 +40,7 @@ def get_google_ads_client(credentials) -> GoogleAdsClient:
4040

4141
@backoff.on_exception(
4242
backoff.expo,
43-
(ServerError, TooManyRequests),
43+
(InternalServerError, ServerError, TooManyRequests),
4444
on_backoff=lambda details: logger.info(
4545
f"Caught retryable error after {details['tries']} tries. Waiting {details['wait']} seconds then retrying..."
4646
),

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

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858

5959

6060
class SourceGoogleAds(AbstractSource):
61-
6261
# Skip exceptions on missing streams
6362
raise_exception_on_missing_stream = False
6463

docs/integrations/sources/google-ads.md

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ Due to a limitation in the Google Ads API which does not allow getting performan
278278

279279
| Version | Date | Pull Request | Subject |
280280
|:---------|:-----------|:---------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------|
281+
| `2.0.2` | 2023-10-31 | [32001](https://github.com/airbytehq/airbyte/pull/32001) | Added handling (retry) for `InternalServerError` while reading the streams |
281282
| `2.0.1` | 2023-10-27 | [31908](https://github.com/airbytehq/airbyte/pull/31908) | Base image migration: remove Dockerfile and use the python-connector-base image |
282283
| `2.0.0` | 2023-10-04 | [31048](https://github.com/airbytehq/airbyte/pull/31048) | Fix schem default streams, change names of streams. |
283284
| `1.0.0` | 2023-09-28 | [30705](https://github.com/airbytehq/airbyte/pull/30705) | Fix schemas for custom queries |

0 commit comments

Comments
 (0)