-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Amazon SP: expand endpoint support (#4863)
* Add GET_FBA_INVENTORY_AGED_DATA data * Add GET_MERCHANT_LISTINGS_ALL_DATA stream support * Update schemas * Update configured_catalog.json * Update connector to airbyte-cdk * Add amazon seller partner test creds * Update state sample files * Apply code format * Update acceptance-test-config.yml * Add dummy integration test * Refactor auth signature. Update streams.py * Remove print_function import from auth.py * Refactor source class. Add pydantic spec. PR fixes. * Add dummy integration test * Typing added. Add _create_prepared_request docstring. * Update docs and spec * Post merge code fixes
- Loading branch information
Showing
32 changed files
with
1,009 additions
and
1,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
airbyte-config/init/src/main/resources/seed/source_definitions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 20 additions & 25 deletions
45
airbyte-integrations/connectors/source-amazon-seller-partner/acceptance-test-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,24 @@ | ||
# See [Source Acceptance Tests](https://docs.airbyte.io/contributing-to-airbyte/building-new-connector/source-acceptance-tests.md) | ||
# for more information about how to configure these tests | ||
connector_image: airbyte/source-amazon-seller-partner:dev | ||
tests: | ||
spec: | ||
- spec_path: "source_amazon_seller_partner/spec.json" | ||
# TODO Uncomment once we get credentials. | ||
# connection: | ||
# - config_path: "secrets/config.json" | ||
# status: "succeed" | ||
# - config_path: "integration_tests/invalid_config.json" | ||
# status: "exception" | ||
# discovery: | ||
# - config_path: "secrets/config.json" | ||
# basic_read: | ||
# - config_path: "secrets/config.json" | ||
# configured_catalog_path: "integration_tests/configured_catalog.json" | ||
# incremental: | ||
# - config_path: "secrets/config.json" | ||
# configured_catalog_path: "integration_tests/configured_catalog.json" | ||
# future_state_path: "integration_tests/abnormal_state.json" | ||
# cursor_paths: | ||
# Orders: | ||
# ["LastUpdateDate"] | ||
# GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL: | ||
# ["purchase-date"] | ||
# full_refresh: | ||
# - config_path: "secrets/config.json" | ||
# configured_catalog_path: "integration_tests/configured_catalog.json" | ||
connection: | ||
- config_path: "secrets/config.json" | ||
status: "succeed" | ||
- config_path: "integration_tests/invalid_config.json" | ||
status: "failed" | ||
discovery: | ||
- config_path: "secrets/config.json" | ||
basic_read: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog_no_orders.json" | ||
empty_streams: [] | ||
incremental: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog_no_orders.json" | ||
future_state_path: "integration_tests/abnormal_state.json" | ||
cursor_paths: | ||
GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL: ["createdTime"] | ||
full_refresh: | ||
- config_path: "secrets/config.json" | ||
configured_catalog_path: "integration_tests/configured_catalog.json" |
12 changes: 9 additions & 3 deletions
12
...ntegrations/connectors/source-amazon-seller-partner/integration_tests/abnormal_state.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"Orders": { | ||
"LastUpdateDate": "2121-07-01T00:00:00Z" | ||
}, | ||
"GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL": { | ||
"purchase-date": "2029-07-24" | ||
"createdTime": "2121-07-01T00:00:00Z" | ||
}, | ||
"Orders": { | ||
"LastUpdateDate": "2029-07-24" | ||
"GET_MERCHANT_LISTINGS_ALL_DATA": { | ||
"createdTime": "2121-07-01T00:00:00Z" | ||
}, | ||
"GET_FBA_INVENTORY_AGED_DATA": { | ||
"createdTime": "2121-07-01T00:00:00Z" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 35 additions & 47 deletions
82
...rations/connectors/source-amazon-seller-partner/integration_tests/configured_catalog.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,52 @@ | ||
{ | ||
"streams": [ | ||
{ | ||
"stream": { | ||
"name": "Orders", | ||
"json_schema": {}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": true, | ||
"default_cursor_field": ["LastUpdateDate"] | ||
}, | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["LastUpdateDate"] | ||
}, | ||
{ | ||
"stream": { | ||
"name": "GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL", | ||
"json_schema": { | ||
"type": "object", | ||
"title": "GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL", | ||
"description": "All orders that were placed in the specified period.", | ||
"properties": { | ||
"amazon-order-id": { | ||
"type": "string", | ||
"title": "amazon-order-id", | ||
"description": "" | ||
}, | ||
"merchant-order-id": { | ||
"type": "string", | ||
"title": "merchant-order-id", | ||
"description": "" | ||
}, | ||
"purchase-date": { | ||
"type": "string", | ||
"title": "purchase-date", | ||
"description": "" | ||
} | ||
} | ||
}, | ||
"json_schema": {}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": true, | ||
"default_cursor_field": ["purchase-date"] | ||
"default_cursor_field": ["createdTime"] | ||
}, | ||
"sync_mode": "full_refresh", | ||
"destination_sync_mode": "overwrite", | ||
"cursor_field": ["purchase-date"] | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["createdTime"] | ||
}, | ||
{ | ||
"stream": { | ||
"name": "Orders", | ||
"json_schema": { | ||
"type": "object", | ||
"title": "Orders", | ||
"description": "All orders that were updated after a specified date", | ||
"properties": { | ||
"AmazonOrderId": { | ||
"type": ["null", "string"] | ||
}, | ||
"PurchaseDate": { | ||
"type": ["null", "string"] | ||
}, | ||
"LastUpdateDate": { | ||
"type": ["null", "string"] | ||
} | ||
} | ||
}, | ||
"name": "GET_MERCHANT_LISTINGS_ALL_DATA", | ||
"json_schema": {}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": true, | ||
"default_cursor_field": ["LastUpdateDate"] | ||
"default_cursor_field": ["createdTime"] | ||
}, | ||
"sync_mode": "full_refresh", | ||
"destination_sync_mode": "overwrite", | ||
"cursor_field": ["LastUpdateDate"] | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["createdTime"] | ||
}, | ||
{ | ||
"stream": { | ||
"name": "GET_FBA_INVENTORY_AGED_DATA", | ||
"json_schema": {}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": true, | ||
"default_cursor_field": ["createdTime"] | ||
}, | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["createdTime"] | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
...nnectors/source-amazon-seller-partner/integration_tests/configured_catalog_no_orders.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"streams": [ | ||
{ | ||
"stream": { | ||
"name": "GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL", | ||
"json_schema": {}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": true, | ||
"default_cursor_field": ["createdTime"] | ||
}, | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["createdTime"] | ||
}, | ||
{ | ||
"stream": { | ||
"name": "GET_MERCHANT_LISTINGS_ALL_DATA", | ||
"json_schema": {}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": true, | ||
"default_cursor_field": ["createdTime"] | ||
}, | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["createdTime"] | ||
}, | ||
{ | ||
"stream": { | ||
"name": "GET_FBA_INVENTORY_AGED_DATA", | ||
"json_schema": {}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"source_defined_cursor": true, | ||
"default_cursor_field": ["createdTime"] | ||
}, | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["createdTime"] | ||
} | ||
] | ||
} |
5 changes: 3 additions & 2 deletions
5
...ntegrations/connectors/source-amazon-seller-partner/integration_tests/invalid_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"start_date": "2021-05-27", | ||
"replication_start_date": "2021-07-01T00:00:00Z", | ||
"refresh_token": "ABC", | ||
"lwa_app_id": "lwa_app_id", | ||
"lwa_client_secret": "lwa_client_secret", | ||
"aws_access_key": "aws_access_key", | ||
"aws_secret_key": "aws_secret_key", | ||
"role_arn": "role_arn", | ||
"marketplace": "marketplace" | ||
"aws_environment": "PRODUCTION", | ||
"region": "US" | ||
} |
11 changes: 11 additions & 0 deletions
11
...integrations/connectors/source-amazon-seller-partner/integration_tests/sample_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"replication_start_date": "2021-07-01T00:00:00Z", | ||
"refresh_token": "<refresh_token>", | ||
"lwa_app_id": "<lwa_app_id>", | ||
"lwa_client_secret": "<lwa_client_secret>", | ||
"aws_access_key": "<aws_access_key>", | ||
"aws_secret_key": "<aws_secret_key>", | ||
"role_arn": "<role_arn>", | ||
"aws_environment": "<PRODUCTION or SANDBOX>", | ||
"region": "US" | ||
} |
14 changes: 14 additions & 0 deletions
14
...-integrations/connectors/source-amazon-seller-partner/integration_tests/sample_state.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"Orders": { | ||
"LastUpdateDate": "2021-07-01T00:00:00Z" | ||
}, | ||
"GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL": { | ||
"createdTime": "2021-07-01T00:00:00Z" | ||
}, | ||
"GET_MERCHANT_LISTINGS_ALL_DATA": { | ||
"createdTime": "2021-07-01T00:00:00Z" | ||
}, | ||
"GET_FBA_INVENTORY_AGED_DATA": { | ||
"createdTime": "2021-07-01T00:00:00Z" | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
airbyte-integrations/connectors/source-amazon-seller-partner/requirements.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.