From 01c3c885450c5089f3e1e81ec9ed7a46997f3a9c Mon Sep 17 00:00:00 2001 From: agroh Date: Fri, 1 Apr 2022 09:00:31 -0400 Subject: [PATCH 1/5] added adId to product report stream --- .../streams/report_streams/products_report.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py b/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py index ea97bf690ae6..821c937faf5a 100644 --- a/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py +++ b/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py @@ -119,6 +119,7 @@ "campaignId", "adGroupName", "adGroupId", + "adId", "impressions", "clicks", "cost", @@ -156,6 +157,7 @@ "adGroupId", "keywordId", "keywordText", + "adId", "asin", "otherAsin", "sku", @@ -179,6 +181,7 @@ "campaignId", "adGroupName", "adGroupId", + "adId", "asin", "otherAsin", "sku", @@ -255,9 +258,17 @@ def _get_init_report_body(self, report_date: str, record_type: str, profile): body = { "reportDate": report_date, } + +# adId is automatically added to the report by amazon and requesting adId causes an amazon error if RecordType.ASINS in record_type: body["campaignType"] = "sponsoredProducts" + metrics_list = copy(metrics_list) + metrics_list.remove("adId") if profile.accountInfo.type == "vendor": metrics_list = copy(metrics_list) metrics_list.remove("sku") + elif RecordType.PRODUCTADS in record_type: + metrics_list = copy(metrics_list) + metrics_list.remove("adId") + return {**body, "metrics": ",".join(metrics_list)} From 00ccf7857c94a4530bbf200bf4081322b285c87c Mon Sep 17 00:00:00 2001 From: agroh1 Date: Fri, 8 Apr 2022 10:58:34 -0400 Subject: [PATCH 2/5] simplified removal of adId --- .../streams/report_streams/products_report.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py b/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py index 821c937faf5a..5229062f2b37 100644 --- a/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py +++ b/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py @@ -262,13 +262,12 @@ def _get_init_report_body(self, report_date: str, record_type: str, profile): # adId is automatically added to the report by amazon and requesting adId causes an amazon error if RecordType.ASINS in record_type: body["campaignType"] = "sponsoredProducts" - metrics_list = copy(metrics_list) - metrics_list.remove("adId") if profile.accountInfo.type == "vendor": metrics_list = copy(metrics_list) metrics_list.remove("sku") - elif RecordType.PRODUCTADS in record_type: - metrics_list = copy(metrics_list) + +# adId is automatically added to the report by amazon and requesting adId causes an amazon error + if "adId" in metrics_list: metrics_list.remove("adId") return {**body, "metrics": ",".join(metrics_list)} From 44ae70817c4eaf6e655101dbd227b45a68f9d1c0 Mon Sep 17 00:00:00 2001 From: agroh1 Date: Fri, 8 Apr 2022 11:52:21 -0400 Subject: [PATCH 3/5] removed duplicate comment --- .../source_amazon_ads/streams/report_streams/products_report.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py b/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py index 5229062f2b37..618a9b80385f 100644 --- a/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py +++ b/airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/streams/report_streams/products_report.py @@ -258,8 +258,6 @@ def _get_init_report_body(self, report_date: str, record_type: str, profile): body = { "reportDate": report_date, } - -# adId is automatically added to the report by amazon and requesting adId causes an amazon error if RecordType.ASINS in record_type: body["campaignType"] = "sponsoredProducts" if profile.accountInfo.type == "vendor": From b9c7dc1787b447b866ea8bcea626e236eabea342 Mon Sep 17 00:00:00 2001 From: agroh1 Date: Fri, 8 Apr 2022 16:26:26 -0400 Subject: [PATCH 4/5] Bumped dockerfile version --- airbyte-integrations/connectors/source-amazon-ads/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-amazon-ads/Dockerfile b/airbyte-integrations/connectors/source-amazon-ads/Dockerfile index 5d7d367c99f2..4098acae90c1 100644 --- a/airbyte-integrations/connectors/source-amazon-ads/Dockerfile +++ b/airbyte-integrations/connectors/source-amazon-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.1.4 +LABEL io.airbyte.version=0.1.5 LABEL io.airbyte.name=airbyte/source-amazon-ads From 5f87976b3ccb0394e7baef43aabaadc0cfe64c1b Mon Sep 17 00:00:00 2001 From: marcosmarxm Date: Wed, 20 Apr 2022 19:24:34 -0300 Subject: [PATCH 5/5] bump connector version --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- airbyte-config/init/src/main/resources/seed/source_specs.yaml | 2 +- airbyte-integrations/connectors/source-amazon-ads/Dockerfile | 2 +- docs/integrations/sources/amazon-ads.md | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index 050406d2a99a..87699194b2ab 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -15,7 +15,7 @@ - name: Amazon Ads sourceDefinitionId: c6b0a29e-1da9-4512-9002-7bfd0cba2246 dockerRepository: airbyte/source-amazon-ads - dockerImageTag: 0.1.5 + dockerImageTag: 0.1.6 documentationUrl: https://docs.airbyte.io/integrations/sources/amazon-ads icon: amazonads.svg sourceType: api diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 92932c037d3e..e9f64093c967 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -87,7 +87,7 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-amazon-ads:0.1.5" +- dockerImage: "airbyte/source-amazon-ads:0.1.6" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/amazon-ads" connectionSpecification: diff --git a/airbyte-integrations/connectors/source-amazon-ads/Dockerfile b/airbyte-integrations/connectors/source-amazon-ads/Dockerfile index 0fde72acea2f..bb4f4e6cb7b2 100644 --- a/airbyte-integrations/connectors/source-amazon-ads/Dockerfile +++ b/airbyte-integrations/connectors/source-amazon-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.1.5 +LABEL io.airbyte.version=0.1.6 LABEL io.airbyte.name=airbyte/source-amazon-ads diff --git a/docs/integrations/sources/amazon-ads.md b/docs/integrations/sources/amazon-ads.md index 2f9e617dac3c..766b6946fa05 100644 --- a/docs/integrations/sources/amazon-ads.md +++ b/docs/integrations/sources/amazon-ads.md @@ -76,6 +76,7 @@ Start date used for generating reports starting from the specified start date. S | Version | Date | Pull Request | Subject | | :--- | :--- | :--- | :--- | +| `0.1.6` | 2022-04-20 | [\#11659](https://github.com/airbytehq/airbyte/pull/11659) | Add adId to products report | | `0.1.5` | 2022-04-08 | [\#11430](https://github.com/airbytehq/airbyte/pull/11430) | `Added support OAuth2.0` | | `0.1.4` | 2022-02-21 | [\#10513](https://github.com/airbytehq/airbyte/pull/10513) | `Increasing REPORT_WAIT_TIMEOUT for supporting report generation which takes longer time ` | | `0.1.3` | 2021-12-28 | [\#8388](https://github.com/airbytehq/airbyte/pull/8388) | `Add retry if recoverable error occured for reporting stream processing` |