-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Source: Amazon Seller Partner - Updated Report API version + New reports #16629
Conversation
Hi @krisjan-oldekamp thanks for the PR. This PR is part of Airbyte's Community Maintainer program and someone from our community will be assigned to review your PR and help it get merged. Thanks for being patient and thanks for improving this connector. |
assigned to @tuanchris |
Hi @krisjan-oldekamp, can you post the logs of passing integration tests and unit test? I tried running your code locally with Airbyte's credentials and was faced with this error: @sajarin can you help check with the team to see if they should update the permissions for the new endpionts? |
@tuanchris what report are you trying to fetch? The multi-country inventory report is only available in Europe (and I see you're trying to request a report in North America -> https://sellingpartnerapi-**na**.amazon.com/reports/2021-06-30/reports). |
@krisjan-oldekamp Oh that can be the case. I'm testing the new streams that you implemented. Can you share the integration tests passing also? |
@tuanchris see logs attached (deleted some of the result data). Good to know, you need to configure these report options, since some of the parameters are mandatory:
I also commited some small changes, as I encountered these issues today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @krisjan-oldekamp, I left a minor comment below, please have a look. Can you also:
- run:
./gradlew :airbyte-integrations:connectors:source-amazon-seller-partner:airbytePythonFormat
and fix some errors? - clean up the codes that you commented out
- I'm not too familiar with the Amazon seller partner API, can you confirm if bumping API version to 2021-06-30 would require users to reconfigure permissions?
@@ -96,7 +101,7 @@ def get_sts_credentials(config: AmazonSellerPartnerConfig) -> dict: | |||
|
|||
def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> Tuple[bool, Any]: | |||
""" | |||
Check connection to Amazon SP API by requesting the list of reports as this endpoint should be available for any config. | |||
Check connection to Amazon SP API by requesting the list of reports as this endpoint should be available for any config. > NOT THE CASE, for VENDOR-ONLY accounts, the Orders endpoint is not available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good to know. Please update the doc to describe the new behavior.
|
@krisjan-oldekamp I was able to run it and created a pull request on your branch here https://github.com/stacktonic-com/airbyte/pull/1 |
minor fix for python format
@tuanchris Thanks a lot, merged the pull request. And I can confirm users don't have to reconfigure permissions when bumping the API version (I was able to fetch all the reports from the previous and the current version with the same credentials that were created months ago / withouth reconfiguring). |
Thank you @krisjan-oldekamp |
/test connector=connectors/source-amazon-seller-partner
Build PassedTest summary info:
|
/publish connector=connectors/source-amazon-seller-partner
if you have connectors that successfully published but failed definition generation, follow step 4 here |
@krisjan-oldekamp, not sure I have permission to push to your branch. Can you bump the version in the Dockerfile and add a line to the changelog in docs/integrations/sources/amazon-seller-partner.md? |
@sajarin Done! |
/publish connector=connectors/source-amazon-seller-partner
if you have connectors that successfully published but failed definition generation, follow step 4 here |
@sajarin hmm, access seems to be related to this issue: community/community#5634 I;ve added you and octavia-squidington-iii as a maintainer manually, but not sure if this would work (since status in "pending invite") |
@sajarin Is it possible for octavia-squidington-iii to accept the invitation or do you see other ways to fix the access issue? |
@krisjan-oldekamp, I think it should be good to merge. |
Thanks @krisjan-oldekamp for the PR and @tuanchris for the review! |
…rts (airbytehq#16629) * Updated Report API version + New reports * Fixed typo and added ability to set fetch period to a fixed range * Removed old code + updated connection test doc * minor fix for python format * Bump version to 0.2.26 and updated docs * Docs update, fix typo in PR number Co-authored-by: Tuan Nguyen <[email protected]> Co-authored-by: Sajarin <[email protected]>
…rts (airbytehq#16629) * Updated Report API version + New reports * Fixed typo and added ability to set fetch period to a fixed range * Removed old code + updated connection test doc * minor fix for python format * Bump version to 0.2.26 and updated docs * Docs update, fix typo in PR number Co-authored-by: Tuan Nguyen <[email protected]> Co-authored-by: Sajarin <[email protected]>
What
Fixed #15539
Updated Amazon Seller Reports API verison
Updated version to version 2020-09-04 to 2021-06-30.
Updated connector test
The connector assumed that the "Orders" report is available for every account. So it used the "Orders" endpoint to check if authenticated successfully. However this is not the case for Vendor-only accounts within Amazon Seller API. So did an alternative check.
When you enter invalid credentials, this is the error message:
However, when you do have valid credentials, but do not have access to the "Orders" endpoint (since thats not available for Vendor only accounts):
So I've added an additional check, that checks if "403 Client Error" is in the the error response, and if so, let the connection test pass.
Added new reports
🚨 User Impact 🚨
No. API version update does not alter fieldnames etc.
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing/publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changesTests
Unit
Put your unit tests output here.
Integration
Put your integration tests output here.
Acceptance
Put your acceptance tests output here.