Skip to content

Commit

Permalink
Source Google Ads: handle 2-Step Verification exception (#35709)
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Inzhyyants <[email protected]>
  • Loading branch information
artem1205 authored Feb 29, 2024
1 parent 41834f6 commit deeb436
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 253487c0-2246-43ba-a21f-5116b20a2c50
dockerImageTag: 3.3.4
dockerImageTag: 3.3.5
dockerRepository: airbyte/source-google-ads
documentationUrl: https://docs.airbyte.com/integrations/sources/google-ads
githubIssueLabel: source-google-ads
Expand Down
4 changes: 2 additions & 2 deletions airbyte-integrations/connectors/source-google-ads/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "3.3.4"
version = "3.3.5"
name = "source-google-ads"
description = "Source implementation for Google Ads."
authors = [ "Airbyte <[email protected]>",]
Expand All @@ -19,7 +19,6 @@ include = "source_google_ads"
python = "^3.9,<3.12"
google-ads = "==22.1.0"
protobuf = "==4.25.2"
pendulum = "==2.1.2"
airbyte-cdk = "==0.58.8"

[tool.poetry.scripts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging
from enum import Enum
from typing import Any, Iterable, Iterator, List, Mapping, MutableMapping, Optional
from typing import Any, Iterable, Iterator, List, Mapping, MutableMapping

import backoff
from airbyte_cdk.models import FailureType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
GeographicView,
KeywordView,
Label,
ServiceAccounts,
ShoppingPerformanceView,
TopicView,
UserInterest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def traced_exception(ga_exception: Union[GoogleAdsException, Unauthenticated], c
f"Ensure the customer is linked to your manager account or check your permissions to access this customer account."
)

elif is_error_type(authentication_error, AuthenticationErrorEnum.AuthenticationError.TWO_STEP_VERIFICATION_NOT_ENROLLED):
message = "An account administrator changed this account's authentication settings. To access this Google Ads account, enable 2-Step Verification in your Google account at https://www.google.com/landing/2step"

# If the error is encountered in the internally used class `ServiceAccounts`, an exception is raised.
# For other classes, the error is logged and skipped to prevent sync failure. See: https://github.com/airbytehq/airbyte/issues/12486
elif is_error_type(authorization_error, AuthorizationErrorEnum.AuthorizationError.CUSTOMER_NOT_ENABLED):
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/google-ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.5` | 2024-02-28 | [35709](https://github.com/airbytehq/airbyte/pull/35709) | Handle 2-Step Verification exception as config error |
| `3.3.4` | 2024-02-21 | [35493](https://github.com/airbytehq/airbyte/pull/35493) | Rolling back the patch 3.3.3 made for `user_interest` steam |
| `3.3.3` | 2024-02-14 | [35280](https://github.com/airbytehq/airbyte/pull/35280) | Temporary patch that disables some fields to avoid 500 error when syncing `user_interest` steam |
| `3.3.2` | 2024-02-12 | [35158](https://github.com/airbytehq/airbyte/pull/35158) | Manage dependencies with Poetry. |
Expand Down

0 comments on commit deeb436

Please sign in to comment.