From 4bab0782a436f94a450b4c3ebd3f612352fb9aa7 Mon Sep 17 00:00:00 2001 From: Zaza Javakhishvili Date: Wed, 28 Dec 2022 05:31:09 -0500 Subject: [PATCH 1/4] amazon seller partner validate connection without orders data --- .../connectors/source-amazon-seller-partner/Dockerfile | 2 +- .../source_amazon_seller_partner/source.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-amazon-seller-partner/Dockerfile b/airbyte-integrations/connectors/source-amazon-seller-partner/Dockerfile index f3a13cfa97b7..5431001a6c31 100644 --- a/airbyte-integrations/connectors/source-amazon-seller-partner/Dockerfile +++ b/airbyte-integrations/connectors/source-amazon-seller-partner/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.29 +LABEL io.airbyte.version=0.2.30 LABEL io.airbyte.name=airbyte/source-amazon-seller-partner diff --git a/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py b/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py index a9ead15029ce..a4259f45eaeb 100644 --- a/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py +++ b/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py @@ -140,9 +140,9 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> return True, None except Exception as e: if isinstance(e, StopIteration): - logger.error( - "Could not check connection without data for Orders stream. Please change value for replication start date field." - ) + # Validate Orders stream without data + if isinstance(e, StopIteration): + return True, None # Additional check, since Vendor-ony accounts within Amazon Seller API will not pass the test without this exception if "403 Client Error" in str(e): From b1b3ae558b80f1d91b137cf8835aacc1e134afd5 Mon Sep 17 00:00:00 2001 From: Zaza Javakhishvili Date: Wed, 28 Dec 2022 05:46:05 -0500 Subject: [PATCH 2/4] amazon seller partner bump version in docs --- docs/integrations/sources/amazon-seller-partner.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/integrations/sources/amazon-seller-partner.md b/docs/integrations/sources/amazon-seller-partner.md index d1d719cc0b0c..9d73c33f6c94 100644 --- a/docs/integrations/sources/amazon-seller-partner.md +++ b/docs/integrations/sources/amazon-seller-partner.md @@ -126,6 +126,7 @@ Make sure to configure the [required parameters](https://developer-docs.amazon.c | Version | Date | Pull Request | Subject | |:---------|:-----------|:-----------------------------------------------------------|:-----------------------------------------------------------------------| +| `0.2.30` | 2022-12-28 | [\#20896](https://github.com/airbytehq/airbyte/pull/20896) | Validate connections without orders data | | `0.2.29` | 2022-11-18 | [\#19581](https://github.com/airbytehq/airbyte/pull/19581) | Use user provided end date for GET_SALES_AND_TRAFFIC_REPORT | | | `0.2.28` | 2022-10-20 | [\#18283](https://github.com/airbytehq/airbyte/pull/18283) | Added multiple (22) report types | | `0.2.26` | 2022-09-24 | [\#16629](https://github.com/airbytehq/airbyte/pull/16629) | Report API version to 2021-06-30, added multiple (5) report types | From e6b086afd18fb0449ecd5ba431ffdeecad799d22 Mon Sep 17 00:00:00 2001 From: Zaza Javakhishvili Date: Mon, 9 Jan 2023 12:49:35 -0500 Subject: [PATCH 3/4] amazon seller partner fix redundant if statement --- .../source_amazon_seller_partner/source.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py b/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py index a4259f45eaeb..de7ef7fcc0f6 100644 --- a/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py +++ b/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py @@ -139,10 +139,9 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> return True, None except Exception as e: + # Validate Orders stream without data if isinstance(e, StopIteration): - # Validate Orders stream without data - if isinstance(e, StopIteration): - return True, None + return True, None # Additional check, since Vendor-ony accounts within Amazon Seller API will not pass the test without this exception if "403 Client Error" in str(e): From dba76385d4158d24c1634fd0b36a75d3cbab7627 Mon Sep 17 00:00:00 2001 From: Octavia Squidington III Date: Mon, 9 Jan 2023 19:20:08 +0000 Subject: [PATCH 4/4] auto-bump connector version --- .../init/src/main/resources/seed/source_definitions.yaml | 2 +- .../init/src/main/resources/seed/source_specs.yaml | 7 ++++++- 2 files changed, 7 insertions(+), 2 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 a82822668d06..68eb97916c26 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -62,7 +62,7 @@ - name: Amazon Seller Partner sourceDefinitionId: e55879a8-0ef8-4557-abcf-ab34c53ec460 dockerRepository: airbyte/source-amazon-seller-partner - dockerImageTag: 0.2.29 + dockerImageTag: 0.2.30 sourceType: api documentationUrl: https://docs.airbyte.com/integrations/sources/amazon-seller-partner icon: amazonsellerpartner.svg 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 a2aed2cefe4b..2a16f4dfea27 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -837,7 +837,7 @@ type: "string" path_in_connector_config: - "client_secret" -- dockerImage: "airbyte/source-amazon-seller-partner:0.2.29" +- dockerImage: "airbyte/source-amazon-seller-partner:0.2.30" spec: documentationUrl: "https://docs.airbyte.com/integrations/sources/amazon-seller-partner" changelogUrl: "https://docs.airbyte.com/integrations/sources/amazon-seller-partner" @@ -902,6 +902,7 @@ pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$" examples: - "2017-01-25T00:00:00Z" + order: 8 type: "string" replication_end_date: title: "End Date" @@ -910,6 +911,7 @@ pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$|^$" examples: - "2017-01-25T00:00:00Z" + order: 9 type: "string" period_in_days: title: "Period In Days" @@ -920,6 +922,7 @@ examples: - "30" - "365" + order: 10 type: "integer" report_options: title: "Report Options" @@ -929,6 +932,7 @@ - "{\"GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT\": {\"reportPeriod\": \"WEEK\"\ }}" - "{\"GET_SOME_REPORT\": {\"custom\": \"true\"}}" + order: 11 type: "string" max_wait_seconds: title: "Max wait time for reports (in seconds)" @@ -938,6 +942,7 @@ examples: - "500" - "1980" + order: 12 type: "integer" aws_environment: title: "AWSEnvironment"