Skip to content

refactor(source-google-ads): Replace AirbyteLogger with logging.Logger #38270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4.2
dockerImageTag: 3.4.3
dockerRepository: airbyte/source-google-ads
documentationUrl: https://docs.airbyte.com/integrations/sources/google-ads
githubIssueLabel: source-google-ads
Expand Down
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.4.2"
version = "3.4.3"
name = "source-google-ads"
description = "Source implementation for Google Ads."
authors = [ "Airbyte <[email protected]>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#


import logging
from contextlib import nullcontext as does_not_raise
from unittest.mock import Mock

import pytest
from airbyte_cdk import AirbyteLogger
from airbyte_cdk.utils import AirbyteTracedException
from source_google_ads.google_ads import GoogleAds
from source_google_ads.models import CustomerModel
Expand Down Expand Up @@ -59,7 +59,7 @@ def test_expected_errors(mocker, config, exception, error_message):
)
source = SourceGoogleAds()
with pytest.raises(AirbyteTracedException) as exception:
status_ok, error = source.check_connection(AirbyteLogger(), config)
status_ok, error = source.check_connection(logging.getLogger("airbyte"), config)
assert exception.value.message == error_message


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
#


import logging
import re
from collections import namedtuple
from unittest.mock import Mock, call

import pendulum
import pytest
from airbyte_cdk import AirbyteLogger
from airbyte_cdk.models import AirbyteStream, ConfiguredAirbyteCatalog, ConfiguredAirbyteStream, DestinationSyncMode, SyncMode
from pendulum import today
from source_google_ads.custom_query_stream import IncrementalCustomQuery
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_read_missing_stream(config, mock_get_customers):
)

try:
list(source.read(AirbyteLogger(), config=config, catalog=catalog))
list(source.read(logging.getLogger("airbyte"), config=config, catalog=catalog))
except KeyError as error:
pytest.fail(str(error))

Expand Down Expand Up @@ -382,7 +382,7 @@ def test_check_connection_should_pass_when_config_valid(mocker):
mocker.patch("source_google_ads.source.GoogleAds", MockGoogleAdsClient)
source = SourceGoogleAds()
check_successful, message = source.check_connection(
AirbyteLogger(),
logging.getLogger("airbyte"),
{
"credentials": {
"developer_token": "fake_developer_token",
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 @@ -303,6 +303,7 @@ Due to a limitation in the Google Ads API which does not allow getting performan

| Version | Date | Pull Request | Subject |
| :------- | :--------- | :------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- |
| 3.4.3 | 2024-05-15 | [0](https://github.com/airbytehq/airbyte/pull/0) | Replace AirbyteLogger with logging.Logger |
| `3.4.2` | 2024-04-24 | [36638](https://github.com/airbytehq/airbyte/pull/36638) | Schema descriptions and CDK 0.80.0 |
| `3.4.1` | 2024-04-08 | [36891](https://github.com/airbytehq/airbyte/pull/36891) | Optimize `check` method |
| `3.4.0` | 2024-03-19 | [36267](https://github.com/airbytehq/airbyte/pull/36267) | Pin airbyte-cdk version to `^0` |
Expand Down
Loading