From 1a9e21f43183266b542c51fa1fdeafaa90939db7 Mon Sep 17 00:00:00 2001 From: Denys Davydov Date: Thu, 12 Oct 2023 16:38:20 +0300 Subject: [PATCH] :rotating_light: :rotating_light: Source Bing Ads: remove PKs from geographic performance reports (#31277) Co-authored-by: katmarkham <40400595+katmarkham@users.noreply.github.com> --- .../connectors/source-bing-ads/Dockerfile | 2 +- .../connectors/source-bing-ads/metadata.yaml | 7 ++++++- .../source-bing-ads/source_bing_ads/source.py | 7 ++----- docs/integrations/sources/bing-ads-migrations.md | 10 ++++++++++ docs/integrations/sources/bing-ads.md | 1 + 5 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 docs/integrations/sources/bing-ads-migrations.md diff --git a/airbyte-integrations/connectors/source-bing-ads/Dockerfile b/airbyte-integrations/connectors/source-bing-ads/Dockerfile index 9e35163c3563..079d1b57db78 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=0.2.3 +LABEL io.airbyte.version=1.0.0 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 8ff4120d8626..d8fc3ee4c87c 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: 0.2.3 + dockerImageTag: 1.0.0 dockerRepository: airbyte/source-bing-ads githubIssueLabel: source-bing-ads icon: bingads.svg @@ -29,5 +29,10 @@ data: ab_internal: sl: 200 ql: 400 + releases: + breakingChanges: + 1.0.0: + message: "Version 1.0.0 removes the primary keys from the geographic performance report streams. This will prevent the connector from loosing data in the incremental append+dedup sync mode because of deduplication and incorrect primary keys. A data reset and schema refresh of all the effected streams is required for the changes to take effect." + upgradeDeadline: "2023-10-25" supportLevel: certified metadataSpecVersion: "1.0" 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 b2587970c7b1..da126a55b1b5 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 @@ -698,7 +698,8 @@ class GeographicPerformanceReport(PerformanceReportsMixin, BingAdsStream): additional_fields: str = "" cursor_field = "TimePeriod" report_schema_name = "geographic_performance_report" - primary_key = [ + + report_columns = [ "AccountId", "CampaignId", "AdGroupId", @@ -713,10 +714,6 @@ class GeographicPerformanceReport(PerformanceReportsMixin, BingAdsStream): "DeviceOS", "TopVsOther", "BidMatchType", - ] - - report_columns = [ - *primary_key, "MetroArea", "State", "City", diff --git a/docs/integrations/sources/bing-ads-migrations.md b/docs/integrations/sources/bing-ads-migrations.md new file mode 100644 index 000000000000..3d378d2517ad --- /dev/null +++ b/docs/integrations/sources/bing-ads-migrations.md @@ -0,0 +1,10 @@ +# Bing Ads Migration Guide + +## Upgrading to 1.0.0 + +This version update only affects the geographic performance reports streams. + +Version 1.0.0 prevents the data loss by removing the primary keys from the `GeographicPerformanceReportMonthly`, `GeographicPerformanceReportWeekly`, `GeographicPerformanceReportDaily`, `GeographicPerformanceReportHourly` streams. +Due to multiple records with the same primary key, users could experience data loss in the incremental append+dedup mode because of deduplication. + +For the changes to take effect, please reset your data and refresh the stream schemas after you have applied the upgrade. \ No newline at end of file diff --git a/docs/integrations/sources/bing-ads.md b/docs/integrations/sources/bing-ads.md index 3f4453fbca2b..f5d8bbc64b88 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.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. | | 0.2.1 | 2023-09-04 | [30128](https://github.com/airbytehq/airbyte/pull/30128) | Add increasing download timeout if ReportingDownloadException occurs |