🚨🚨🐛Source Amazon Seller Partner: update schema for GET_FBA_STORAGE_FEE_CHARGES_DATA stream (#35439)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# Amazon Seller-Partner Source
|
||||
# Amazon Seller Partner Source
|
||||
|
||||
|
||||
This is the repository for the Amazon Seller-Partner source connector, written in Python.
|
||||
For information about how to use this connector within Airbyte, see [the documentation](https://docs.airbyte.io/integrations/sources/amazon-seller-partner).
|
||||
@@ -6,61 +7,49 @@ For information about how to use this connector within Airbyte, see [the documen
|
||||
## Local development
|
||||
|
||||
### Prerequisites
|
||||
**To iterate on this connector, make sure to complete this prerequisites section.**
|
||||
* Python (~=3.9)
|
||||
* Poetry (~=1.7) - installation instructions [here](https://python-poetry.org/docs/#installation)
|
||||
|
||||
#### Build & Activate Virtual Environment and install dependencies
|
||||
From this connector directory, create a virtual environment:
|
||||
```
|
||||
python -m venv .venv
|
||||
|
||||
### Installing the connector
|
||||
From this connector directory, run:
|
||||
```bash
|
||||
poetry install --with dev
|
||||
```
|
||||
|
||||
This will generate a virtualenv for this module in `.venv/`. Make sure this venv is active in your
|
||||
development environment of choice. To activate it from the terminal, run:
|
||||
```
|
||||
source .venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
If you are in an IDE, follow your IDE's instructions to activate the virtualenv.
|
||||
|
||||
Note that while we are installing dependencies from `requirements.txt`, you should only edit `setup.py` for your dependencies. `requirements.txt` is
|
||||
used for editable installs (`pip install -e`) to pull in Python dependencies from the monorepo and will call `setup.py`.
|
||||
If this is mumbo jumbo to you, don't worry about it, just put your deps in `setup.py` but install using `pip install -r requirements.txt` and everything
|
||||
should work as you expect.
|
||||
|
||||
#### Create credentials
|
||||
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.io/integrations/sources/amazon-seller-partner)
|
||||
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_amazon_seller-partner/integration_tests/spec.json` file.
|
||||
Note that the `secrets` directory is gitignored by default, so there is no danger of accidentally checking in sensitive information.
|
||||
### Create credentials
|
||||
**If you are a community contributor**, follow the instructions in the [documentation](https://docs.airbyte.com/integrations/sources/amazon-seller-partner)
|
||||
to generate the necessary credentials. Then create a file `secrets/config.json` conforming to the `source_amazon_seller_partner/spec.json` file.
|
||||
Note that any directory named `secrets` is gitignored across the entire Airbyte repo, so there is no danger of accidentally checking in sensitive information.
|
||||
See `integration_tests/sample_config.json` for a sample config file.
|
||||
|
||||
**If you are an Airbyte core member**, copy the credentials in Lastpass under the secret name `source amazon-seller-partner test creds`
|
||||
and place them into `secrets/config.json`.
|
||||
|
||||
### Locally running the connector
|
||||
```
|
||||
python main.py spec
|
||||
python main.py check --config secrets/config.json
|
||||
python main.py discover --config secrets/config.json
|
||||
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
|
||||
poetry run source-amazon-seller-partner spec
|
||||
poetry run source-amazon-seller-partner check --config secrets/config.json
|
||||
poetry run source-amazon-seller-partner discover --config secrets/config.json
|
||||
poetry run source-amazon-seller-partner read --config secrets/config.json --catalog integration_tests/configured_catalog.json
|
||||
```
|
||||
|
||||
### Locally running the connector docker image
|
||||
### Running unit tests
|
||||
To run unit tests locally, from the connector directory run:
|
||||
```
|
||||
poetry run pytest unit_tests
|
||||
```
|
||||
|
||||
|
||||
#### Build
|
||||
**Via [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md) (recommended):**
|
||||
### Building the docker image
|
||||
1. Install [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md)
|
||||
2. Run the following command to build the docker image:
|
||||
```bash
|
||||
airbyte-ci connectors --name=source-amazon-seller-partner build
|
||||
```
|
||||
|
||||
An image will be built with the tag `airbyte/source-amazon-seller-partner:dev`.
|
||||
An image will be available on your host with the tag `airbyte/source-amazon-seller-partner:dev`.
|
||||
|
||||
**Via `docker build`:**
|
||||
```bash
|
||||
docker build -t airbyte/source-amazon-seller-partner:dev .
|
||||
```
|
||||
|
||||
#### Run
|
||||
### Running as a docker container
|
||||
Then run any of the connector commands as follows:
|
||||
```
|
||||
docker run --rm airbyte/source-amazon-seller-partner:dev spec
|
||||
@@ -69,29 +58,34 @@ docker run --rm -v $(pwd)/secrets:/secrets airbyte/source-amazon-seller-partner:
|
||||
docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integration_tests airbyte/source-amazon-seller-partner:dev read --config /secrets/config.json --catalog /integration_tests/configured_catalog.json
|
||||
```
|
||||
|
||||
## Testing
|
||||
### Running our CI test suite
|
||||
You can run our full test suite locally using [`airbyte-ci`](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/pipelines/README.md):
|
||||
```bash
|
||||
airbyte-ci connectors --name=source-amazon-seller-partner test
|
||||
```
|
||||
|
||||
### Customizing acceptance Tests
|
||||
Customize `acceptance-test-config.yml` file to configure tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
|
||||
Customize `acceptance-test-config.yml` file to configure acceptance tests. See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) for more information.
|
||||
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
|
||||
|
||||
## Dependency Management
|
||||
All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development.
|
||||
We split dependencies between two groups, dependencies that are:
|
||||
* required for your connector to work need to go to `MAIN_REQUIREMENTS` list.
|
||||
* required for the testing need to go to `TEST_REQUIREMENTS` list
|
||||
### Dependency Management
|
||||
All of your dependencies should be managed via Poetry.
|
||||
To add a new dependency, run:
|
||||
```bash
|
||||
poetry add <package-name>
|
||||
```
|
||||
|
||||
### Publishing a new version of the connector
|
||||
Please commit the changes to `pyproject.toml` and `poetry.lock` files.
|
||||
|
||||
## Publishing a new version of the connector
|
||||
You've checked out the repo, implemented a million dollar feature, and you're ready to share your changes with the world. Now what?
|
||||
1. Make sure your changes are passing our test suite: `airbyte-ci connectors --name=source-amazon-seller-partner test`
|
||||
2. Bump the connector version in `metadata.yaml`: increment the `dockerImageTag` value. Please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors).
|
||||
2. Bump the connector version (please follow [semantic versioning for connectors](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#semantic-versioning-for-connectors)):
|
||||
- bump the `dockerImageTag` value in in `metadata.yaml`
|
||||
- bump the `version` value in `pyproject.toml`
|
||||
3. Make sure the `metadata.yaml` content is up to date.
|
||||
4. Make the connector documentation and its changelog is up to date (`docs/integrations/sources/amazon-seller-partner.md`).
|
||||
4. Make sure the connector documentation and its changelog is up to date (`docs/integrations/sources/amazon-seller-partner.md`).
|
||||
5. Create a Pull Request: use [our PR naming conventions](https://docs.airbyte.com/contributing-to-airbyte/resources/pull-requests-handbook/#pull-request-title-convention).
|
||||
6. Pat yourself on the back for being an awesome contributor.
|
||||
7. Someone from Airbyte will take a look at your PR and iterate with you to merge it into master.
|
||||
|
||||
8. Once your PR is merged, the new version of the connector will be automatically published to Docker Hub and our connector registry.
|
||||
@@ -15,7 +15,7 @@ data:
|
||||
connectorSubtype: api
|
||||
connectorType: source
|
||||
definitionId: e55879a8-0ef8-4557-abcf-ab34c53ec460
|
||||
dockerImageTag: 3.5.0
|
||||
dockerImageTag: 4.0.0
|
||||
dockerRepository: airbyte/source-amazon-seller-partner
|
||||
documentationUrl: https://docs.airbyte.com/integrations/sources/amazon-seller-partner
|
||||
githubIssueLabel: source-amazon-seller-partner
|
||||
@@ -45,11 +45,16 @@ data:
|
||||
upgradeDeadline: "2023-12-11"
|
||||
3.0.0:
|
||||
message:
|
||||
Streams 'GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL' and 'GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL' now have updated schemas.
|
||||
Streams 'GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL', 'GET_LEDGER_DETAIL_VIEW_DATA', 'GET_MERCHANTS_LISTINGS_FYP_REPORT',
|
||||
'GET_STRANDED_INVENTORY_UI_DATA', and 'GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE' now have date-time formatted fields.
|
||||
Streams `GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL` and `GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL` now have updated schemas.
|
||||
Streams `GET_AMAZON_FULFILLED_SHIPMENTS_DATA_GENERAL`, `GET_LEDGER_DETAIL_VIEW_DATA`, `GET_MERCHANTS_LISTINGS_FYP_REPORT`,
|
||||
`GET_STRANDED_INVENTORY_UI_DATA`, and `GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE` now have date-time formatted fields.
|
||||
Users will need to refresh the source schemas and reset these streams after upgrading.
|
||||
upgradeDeadline: "2024-01-12"
|
||||
4.0.0:
|
||||
message:
|
||||
Stream `GET_FBA_STORAGE_FEE_CHARGES_DATA` schema has been updated to match Amazon Seller Partner.
|
||||
Users will need to refresh the source schema and reset this stream after upgrading.
|
||||
upgradeDeadline: "2024-03-11"
|
||||
supportLevel: community
|
||||
tags:
|
||||
- language:python
|
||||
|
||||
1222
airbyte-integrations/connectors/source-amazon-seller-partner/poetry.lock
generated
Normal file
1222
airbyte-integrations/connectors/source-amazon-seller-partner/poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
version = "4.0.0"
|
||||
name = "source-amazon-seller-partner"
|
||||
description = "Source implementation for Amazon Seller Partner."
|
||||
authors = ["Airbyte <contact@airbyte.io>"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
documentation = "https://docs.airbyte.com/integrations/sources/amazon-seller-partner"
|
||||
homepage = "https://airbyte.com"
|
||||
repository = "https://github.com/airbytehq/airbyte"
|
||||
[[tool.poetry.packages]]
|
||||
include = "source_amazon_seller_partner"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.9,<3.12"
|
||||
airbyte-cdk = "*"
|
||||
xmltodict = "~=0.12"
|
||||
dateparser = "==1.2.0"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
source-amazon-seller-partner = "source_amazon_seller_partner.run:run"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pytest-mock = "^3.6"
|
||||
freezegun = "==1.2.2"
|
||||
pytest = "~=6.1"
|
||||
requests-mock = "~=1.9.3"
|
||||
@@ -1 +0,0 @@
|
||||
-e .
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
|
||||
#
|
||||
|
||||
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
MAIN_REQUIREMENTS = ["airbyte-cdk", "xmltodict~=0.12", "dateparser==1.2.0"]
|
||||
|
||||
TEST_REQUIREMENTS = ["requests-mock~=1.9.3", "pytest~=6.1", "pytest-mock", "freezegun==1.2.2"]
|
||||
|
||||
setup(
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"source-amazon-seller-partner=source_amazon_seller_partner.run:run",
|
||||
],
|
||||
},
|
||||
name="source_amazon_seller_partner",
|
||||
description="Source implementation for Amazon Seller Partner.",
|
||||
author="Airbyte",
|
||||
author_email="contact@airbyte.io",
|
||||
packages=find_packages(),
|
||||
install_requires=MAIN_REQUIREMENTS,
|
||||
package_data={
|
||||
"": [
|
||||
# Include yaml files in the package (if any)
|
||||
"*.yml",
|
||||
"*.yaml",
|
||||
# Include all json files in the package, up to 4 levels deep
|
||||
"*.json",
|
||||
"*/*.json",
|
||||
"*/*/*.json",
|
||||
"*/*/*/*.json",
|
||||
"*/*/*/*/*.json",
|
||||
]
|
||||
},
|
||||
extras_require={
|
||||
"tests": TEST_REQUIREMENTS,
|
||||
},
|
||||
)
|
||||
@@ -10,73 +10,73 @@
|
||||
"fnsku": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"product-name": {
|
||||
"product_name": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"fulfillment-center": {
|
||||
"fulfillment_center": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"country-code": {
|
||||
"country_code": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"longest-side": {
|
||||
"longest_side": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"median-side": {
|
||||
"median_side": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"shortest-side": {
|
||||
"shortest_side": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"measurement-units": {
|
||||
"measurement_units": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"weight": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"weight-units": {
|
||||
"weight_units": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"item-volume": {
|
||||
"item_volume": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"volume-units": {
|
||||
"volume_units": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"product-size-tier": {
|
||||
"product_size_tier": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"average-quantity-on-hand": {
|
||||
"average_quantity_on_hand": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"average-quantity-pending-removal": {
|
||||
"average_quantity_pending_removal": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"estimated-total-item-volume": {
|
||||
"estimated_total_item_volume": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"month-of-charge": {
|
||||
"month_of_charge": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"storage-rate": {
|
||||
"storage_rate": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"estimated-monthly-storage-fee": {
|
||||
"estimated_monthly_storage_fee": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"currency": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"average-quantity-customer-orders": {
|
||||
"average_quantity_customer_orders": {
|
||||
"type": ["null", "number"]
|
||||
},
|
||||
"base-rate": {
|
||||
"base_rate": {
|
||||
"type": ["null", "number"]
|
||||
},
|
||||
"breakdown-incentive-fee-amount": {
|
||||
"breakdown_incentive_fee_amount": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"dangerous-goods-storage-type": {
|
||||
"dangerous_goods_storage_type": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"eligible_for_inventory_discount": {
|
||||
@@ -85,16 +85,16 @@
|
||||
"qualifies_for_inventory_discount": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"storage-utilization-ratio": {
|
||||
"storage_utilization_ratio": {
|
||||
"type": ["null", "number"]
|
||||
},
|
||||
"storage-utilization-ratio-units": {
|
||||
"storage_utilization_ratio_units": {
|
||||
"type": ["null", "string"]
|
||||
},
|
||||
"total-incentive-fee-amount": {
|
||||
"total_incentive_fee_amount": {
|
||||
"type": ["null", "number"]
|
||||
},
|
||||
"utilization-surcharge-rate": {
|
||||
"utilization_surcharge_rate": {
|
||||
"type": ["null", "number"]
|
||||
},
|
||||
"dataEndTime": {
|
||||
|
||||
@@ -1,5 +1,34 @@
|
||||
# Amazon Seller Partner Migration Guide
|
||||
|
||||
## Upgrading to 4.0.0
|
||||
|
||||
Stream `GET_FBA_STORAGE_FEE_CHARGES_DATA` now has updated schema, which matches Amazon Seller Partner [docs](https://developer-docs.amazon.com/sp-api/docs/fba-inventory-reports-attributes#get_fba_storage_fee_charges_data).
|
||||
|
||||
Users will need to refresh the source schema and reset this stream after upgrading.
|
||||
|
||||
### Refresh affected schemas and reset data
|
||||
|
||||
1. Select **Connections** in the main navbar.
|
||||
1. Select the connection(s) affected by the update.
|
||||
2. Select the **Replication** tab.
|
||||
1. Select **Refresh source schema**.
|
||||
2. Select **OK**.
|
||||
```note
|
||||
Any detected schema changes will be listed for your review.
|
||||
```
|
||||
3. Select **Save changes** at the bottom of the page.
|
||||
1. Ensure the **Reset affected streams** option is checked.
|
||||
```note
|
||||
Depending on destination type you may not be prompted to reset your data.
|
||||
```
|
||||
4. Select **Save connection**.
|
||||
```note
|
||||
This will reset the data in your destination and initiate a fresh sync.
|
||||
```
|
||||
|
||||
For more information on resetting your data in Airbyte, see [this page](https://docs.airbyte.com/operator-guides/reset).
|
||||
|
||||
|
||||
## Upgrading to 3.0.0
|
||||
|
||||
Streams `GET_FLAT_FILE_ALL_ORDERS_DATA_BY_ORDER_DATE_GENERAL` and `GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL` now have updated schemas.
|
||||
|
||||
@@ -168,6 +168,7 @@ Information about rate limits you may find [here](https://developer-docs.amazon.
|
||||
|
||||
| Version | Date | Pull Request | Subject |
|
||||
|:---------|:-----------|:------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `4.0.0` | 2024-02-23 | [\#35439](https://github.com/airbytehq/airbyte/pull/35439) | Update schema for the `GET_FBA_STORAGE_FEE_CHARGES_DATA` stream |
|
||||
| `3.5.0` | 2024-02-09 | [\#35331](https://github.com/airbytehq/airbyte/pull/35331) | Fix check for Vendor accounts. Add failed report result message |
|
||||
| `3.4.0` | 2024-02-15 | [\#35273](https://github.com/airbytehq/airbyte/pull/35273) | Add `VendorOrders` stream |
|
||||
| `3.3.2` | 2024-02-13 | [\#33996](https://github.com/airbytehq/airbyte/pull/33996) | Add integration tests |
|
||||
|
||||
Reference in New Issue
Block a user