diff --git a/airbyte-integrations/connectors/source-bing-ads/Dockerfile b/airbyte-integrations/connectors/source-bing-ads/Dockerfile index 079d1b57db78e..5cf61c8a10678 100644 --- a/airbyte-integrations/connectors/source-bing-ads/Dockerfile +++ b/airbyte-integrations/connectors/source-bing-ads/Dockerfile @@ -12,5 +12,5 @@ RUN pip install . ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] -LABEL io.airbyte.version=1.0.0 +LABEL io.airbyte.version=1.0.1 LABEL io.airbyte.name=airbyte/source-bing-ads diff --git a/airbyte-integrations/connectors/source-bing-ads/metadata.yaml b/airbyte-integrations/connectors/source-bing-ads/metadata.yaml index 79a9adc06b4ab..bbba8cb69f28f 100644 --- a/airbyte-integrations/connectors/source-bing-ads/metadata.yaml +++ b/airbyte-integrations/connectors/source-bing-ads/metadata.yaml @@ -11,7 +11,7 @@ data: connectorSubtype: api connectorType: source definitionId: 47f25999-dd5e-4636-8c39-e7cea2453331 - dockerImageTag: 1.0.0 + dockerImageTag: 1.0.1 dockerRepository: airbyte/source-bing-ads githubIssueLabel: source-bing-ads icon: bingads.svg diff --git a/airbyte-integrations/connectors/source-bing-ads/source_bing_ads/source.py b/airbyte-integrations/connectors/source-bing-ads/source_bing_ads/source.py index da126a55b1b56..7d32cb18b6cef 100644 --- a/airbyte-integrations/connectors/source-bing-ads/source_bing_ads/source.py +++ b/airbyte-integrations/connectors/source-bing-ads/source_bing_ads/source.py @@ -699,6 +699,10 @@ class GeographicPerformanceReport(PerformanceReportsMixin, BingAdsStream): cursor_field = "TimePeriod" report_schema_name = "geographic_performance_report" + # Need to override the primary key here because the one inherited from the PerformanceReportsMixin + # is incorrect for the geographic performance reports + primary_key = None + report_columns = [ "AccountId", "CampaignId", diff --git a/airbyte-integrations/connectors/source-bing-ads/unit_tests/test_reports.py b/airbyte-integrations/connectors/source-bing-ads/unit_tests/test_reports.py index 4d82a559d91f6..8763c1ea8bcf0 100644 --- a/airbyte-integrations/connectors/source-bing-ads/unit_tests/test_reports.py +++ b/airbyte-integrations/connectors/source-bing-ads/unit_tests/test_reports.py @@ -3,11 +3,19 @@ # import copy +from unittest.mock import Mock import pendulum +import pytest from bingads.v13.internal.reporting.row_report_iterator import _RowReportRecord, _RowValues from source_bing_ads.reports import PerformanceReportsMixin, ReportsMixin -from source_bing_ads.source import SourceBingAds +from source_bing_ads.source import ( + GeographicPerformanceReportDaily, + GeographicPerformanceReportHourly, + GeographicPerformanceReportMonthly, + GeographicPerformanceReportWeekly, + SourceBingAds, +) class TestClient: @@ -137,3 +145,23 @@ def test_report_get_start_date_performance_report_wo_stream_state(): stream_state = {} account_id = "123" assert reports_start_date.subtract(days=days_to_subtract) == test_report.get_start_date(stream_state, account_id) + + +@pytest.mark.parametrize( + "performance_report_cls", + ( + GeographicPerformanceReportDaily, + GeographicPerformanceReportHourly, + GeographicPerformanceReportMonthly, + GeographicPerformanceReportWeekly, + ), +) +def test_geographic_performance_report_pk(performance_report_cls): + config = { + "developer_token": "developer_token", + "client_id": "client_id", + "refresh_token": "refresh_token", + "reports_start_date": "2020-01-01T00:00:00Z", + } + stream = performance_report_cls(client=Mock(), config=config) + assert stream.primary_key is None diff --git a/docs/integrations/sources/bing-ads.md b/docs/integrations/sources/bing-ads.md index f5d8bbc64b880..c967c348bcece 100644 --- a/docs/integrations/sources/bing-ads.md +++ b/docs/integrations/sources/bing-ads.md @@ -123,6 +123,7 @@ The Bing Ads API limits the number of requests for all Microsoft Advertising cli | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------| +| 1.0.1 | 2023-10-16 | [31432](https://github.com/airbytehq/airbyte/pull/31432) | Remove primary keys from the geographic performance reports - complete what was missed in version 1.0.0 | | 1.0.0 | 2023-10-11 | [31277](https://github.com/airbytehq/airbyte/pull/31277) | Remove primary keys from the geographic performance reports. | | 0.2.3 | 2023-09-28 | [30834](https://github.com/airbytehq/airbyte/pull/30834) | Wrap auth error with the config error. | | 0.2.2 | 2023-09-27 | [30791](https://github.com/airbytehq/airbyte/pull/30791) | Fix missing fields for geographic performance reports. |