Skip to content
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: Add new streams #13604

Conversation

vladimir-remar
Copy link
Contributor

What

Add two new report types:

  • GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA
  • GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here

Tests

Unit
============================================================================================ test session starts =============================================================================================
platform linux -- Python 3.9.13, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /home/vladimir/.virtualenvs/amzseller/bin/python
cachedir: .pytest_cache
rootdir: /home/vladimir/Work/Airbyte_projects/Fork/airbyte, configfile: pytest.ini
plugins: mock-3.7.0
collected 93 items                                                                                                                                                                                           

unit_tests/test_finance_streams.py::test_finance_stream_next_token PASSED
unit_tests/test_finance_streams.py::test_financial_event_groups_stream_request_params PASSED
unit_tests/test_finance_streams.py::test_financial_event_groups_stream_parse_response PASSED
unit_tests/test_finance_streams.py::test_financial_events_stream_request_params PASSED
unit_tests/test_finance_streams.py::test_financial_events_stream_parse_response PASSED
unit_tests/test_reports_streams_rate_limits.py::test_reports_stream_should_retry PASSED
unit_tests/test_reports_streams_rate_limits.py::test_reports_stream_send_request PASSED
unit_tests/test_reports_streams_rate_limits.py::test_reports_stream_send_request_backoff_exception {"type": "LOG", "log": {"level": "INFO", "message": "Backing off _send_request(...) for 5.0s (airbyte_cdk.sources.streams.http.exceptions.DefaultBackoffException: Request URL: None, Response Code: 429, Response Text: )"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error 'Request URL: None, Response Code: 429, Response Text: ' after 1 tries. Waiting 5 seconds then retrying..."}}
{"type": "LOG", "log": {"level": "INFO", "message": "Backing off _send_request(...) for 10.0s (airbyte_cdk.sources.streams.http.exceptions.DefaultBackoffException: Request URL: None, Response Code: 429, Response Text: )"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error 'Request URL: None, Response Code: 429, Response Text: ' after 2 tries. Waiting 10 seconds then retrying..."}}
{"type": "LOG", "log": {"level": "INFO", "message": "Backing off _send_request(...) for 20.0s (airbyte_cdk.sources.streams.http.exceptions.DefaultBackoffException: Request URL: None, Response Code: 429, Response Text: )"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error 'Request URL: None, Response Code: 429, Response Text: ' after 3 tries. Waiting 20 seconds then retrying..."}}
{"type": "LOG", "log": {"level": "INFO", "message": "Backing off _send_request(...) for 40.0s (airbyte_cdk.sources.streams.http.exceptions.DefaultBackoffException: Request URL: None, Response Code: 429, Response Text: )"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error 'Request URL: None, Response Code: 429, Response Text: ' after 4 tries. Waiting 40 seconds then retrying..."}}
{"type": "LOG", "log": {"level": "ERROR", "message": "Giving up _send_request(...) after 5 tries (airbyte_cdk.sources.streams.http.exceptions.DefaultBackoffException: Request URL: None, Response Code: 429, Response Text: )"}}
PASSED
unit_tests/test_source.py::test_spec PASSED
unit_tests/test_source.py::test_streams PASSED
unit_tests/test_source.py::test_stream_with_good_iam_arn_value[arn:aws:iam::123456789098:user/some-user] PASSED
unit_tests/test_source.py::test_stream_with_good_iam_arn_value[arn:aws:iam::123456789098:role/some-role] PASSED
unit_tests/test_source.py::test_stream_with_bad_iam_arn_value PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data0-expected_data0] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data1-expected_data1] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data2-expected_data2] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data3-expected_data3] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data4-expected_data4] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data5-expected_data5] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data6-expected_data6] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data7-expected_data7] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data8-expected_data8] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data9-expected_data9] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data10-expected_data10] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data11-expected_data11] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data12-expected_data12] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data13-expected_data13] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data14-expected_data14] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data15-expected_data15] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data16-expected_data16] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data17-expected_data17] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data18-expected_data18] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data19-expected_data19] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data20-expected_data20] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data21-expected_data21] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data22-expected_data22] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data23-expected_data23] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data24-expected_data24] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data25-expected_data25] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data26-expected_data26] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data27-expected_data27] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data28-expected_data28] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data29-expected_data29] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data30-expected_data30] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data31-expected_data31] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data32-expected_data32] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data33-expected_data33] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data34-expected_data34] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data35-expected_data35] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data36-expected_data36] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data37-expected_data37] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data38-expected_data38] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data39-expected_data39] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data40-expected_data40] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data41-expected_data41] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data42-expected_data42] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data43-expected_data43] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data44-expected_data44] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data45-expected_data45] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data46-expected_data46] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data47-expected_data47] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data48-expected_data48] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data49-expected_data49] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data50-expected_data50] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data51-expected_data51] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data52-expected_data52] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data53-expected_data53] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data54-expected_data54] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data55-expected_data55] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data56-expected_data56] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data57-expected_data57] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data58-expected_data58] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data59-expected_data59] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data60-expected_data60] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data61-expected_data61] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data62-expected_data62] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data63-expected_data63] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data64-expected_data64] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data65-expected_data65] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data66-expected_data66] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data67-expected_data67] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data68-expected_data68] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data69-expected_data69] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data70-expected_data70] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data71-expected_data71] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data72-expected_data72] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data73-expected_data73] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data74-expected_data74] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data75-expected_data75] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data76-expected_data76] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data77-expected_data77] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data78-expected_data78] PASSED
unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data79-expected_data79] PASSED

============================================================================================== warnings summary ==============================================================================================
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_finance_streams.py::test_finance_stream_next_token
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_finance_streams.py::test_financial_event_groups_stream_request_params
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_finance_streams.py::test_financial_event_groups_stream_parse_response
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_finance_streams.py::test_financial_events_stream_request_params
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_finance_streams.py::test_financial_events_stream_parse_response
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams
  /home/vladimir/.virtualenvs/amzseller/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http.py:42: DeprecationWarning: Call to deprecated class NoAuth. (Set `authenticator=None` instead) -- Deprecated since version 0.1.20.
    self._authenticator: HttpAuthenticator = NoAuth()

airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_finance_streams.py: 5 warnings
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py: 5 warnings
  /home/vladimir/.virtualenvs/amzseller/lib/python3.9/site-packages/deprecated/classic.py:173: DeprecationWarning: Call to deprecated class HttpAuthenticator. (Use requests.auth.AuthBase instead) -- Deprecated since version 0.1.20.
    return old_new1(cls, *args, **kwargs)

airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams
  /home/vladimir/Work/Airbyte_projects/Fork/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py:55: DeprecationWarning: Call to deprecated class Oauth2Authenticator. (Use airbyte_cdk.sources.streams.http.requests_native_auth.Oauth2Authenticator instead) -- Deprecated since version 0.1.20.
    auth = AWSAuthenticator(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================================================================================== 93 passed, 20 warnings in 0.77s =======================================================================================
Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@github-actions github-actions bot added the area/connectors Connector related issues label Jun 8, 2022
@alafanechere alafanechere added the bounty-S Maintainer program: claimable small bounty PR label Jun 9, 2022
@harshithmullapudi harshithmullapudi self-assigned this Jun 10, 2022
@harshithmullapudi
Copy link
Contributor

@vladimir-remar thanks for the contribution. Could you help with these things

  1. Run ./gradlew format
  2. Follow these steps for updating connector https://docs.airbyte.com/connector-development/#updating-an-existing-connector

@harshithmullapudi
Copy link
Contributor

harshithmullapudi commented Jun 15, 2022

/test connector=connectors/source-amazon-seller-partner

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2502094840
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2502094840
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        77      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/tests/test_incremental.py       121     25    79%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_core.py              294    106    64%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  960    246    74%
Name                                        Stmts   Miss  Cover
---------------------------------------------------------------
source_amazon_seller_partner/spec.py           23      0   100%
source_amazon_seller_partner/__init__.py        2      0   100%
source_amazon_seller_partner/constants.py      37      1    97%
source_amazon_seller_partner/source.py         49     10    80%
source_amazon_seller_partner/streams.py       465    216    54%
source_amazon_seller_partner/auth.py           61     36    41%
---------------------------------------------------------------
TOTAL                                         637    263    59%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestBasicRead.test_read because not found in the config
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestFullRefresh.test_sequential_reads because not found in the config
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config
======================== 17 passed, 3 skipped in 5.86s =========================

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jun 20, 2022
@vladimir-remar
Copy link
Contributor Author

@vladimir-remar thanks for the contribution. Could you help with these things

  1. Run ./gradlew format
  2. Follow these steps for updating connector https://docs.airbyte.com/connector-development/#updating-an-existing-connector

Hello @harshithmullapudi, this is my format output

vladimir@vremar:airbyte$ ./gradlew :airbyte-integrations:connectors:source-amazon-seller-partner:airbytePythonFormat
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Building all of Airbyte.
/home/vladimir/Work/Airbyte_projects/Fork/airbyte/airbyte-integrations/connectors
Type-safe dependency accessors is an incubating feature.

> Task :airbyte-integrations:connectors:source-amazon-seller-partner:checkPython
Using python 3.9.13 from /home/vladimir/Work/Airbyte_projects/Fork/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv (.venv/bin/python)
Using pip 21.3.1 from /home/vladimir/Work/Airbyte_projects/Fork/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/lib/python3.9/site-packages/pip (python 3.9)

> Task :airbyte-integrations:connectors:source-amazon-seller-partner:pipInstall
[python] .venv/bin/python -m pip install pip==21.3.1
         Requirement already satisfied: pip==21.3.1 in ./.venv/lib/python3.9/site-packages (21.3.1)
         WARNING: You are using pip version 21.3.1; however, version 22.1.2 is available.
         You should consider upgrading via the '/home/vladimir/Work/Airbyte_projects/Fork/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/bin/python -m pip install --upgrade pip' command.
[python] .venv/bin/python -m pip list --format=columns
         Package           Version
         ----------------- -------
         attrs             21.4.0
         black             22.3.0
         click             8.1.3
         coverage          6.3.1
         flake8            4.0.1
         iniconfig         1.1.1
         isort             5.6.4
         mccabe            0.6.1
         mypy              0.930
         mypy-extensions   0.4.3
         packaging         21.3
         pathspec          0.9.0
         pip               21.3.1
         platformdirs      2.5.2
         pluggy            0.13.1
         py                1.11.0
         pycodestyle       2.8.0
         pyflakes          2.4.0
         pyparsing         3.0.9
         pyproject-flake8  0.0.1a2
         pytest            6.1.2
         setuptools        62.1.0
         toml              0.10.2
         tomli             2.0.1
         typing_extensions 4.2.0
         wheel             0.37.1
         WARNING: You are using pip version 21.3.1; however, version 22.1.2 is available.
         You should consider upgrading via the '/home/vladimir/Work/Airbyte_projects/Fork/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/bin/python -m pip install --upgrade pip' command.

> Task :airbyte-integrations:connectors:source-amazon-seller-partner:isortFormat
[python] .venv/bin/python -m isort --settings-file=/home/vladimir/Work/Airbyte_projects/Fork/airbyte/pyproject.toml ./
         Skipped 6 files

> Task :airbyte-integrations:connectors:source-amazon-seller-partner:blackFormat
[python] .venv/bin/python -m black --config /home/vladimir/Work/Airbyte_projects/Fork/airbyte/pyproject.toml ./
         All done! ✨ 🍰 ✨
         14 files left unchanged.

> Task :airbyte-integrations:connectors:source-amazon-seller-partner:flakeCheck
[python] .venv/bin/python -m pflake8 --config /home/vladimir/Work/Airbyte_projects/Fork/airbyte/pyproject.toml ./

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 44s
16 actionable tasks: 9 executed, 7 up-to-date


return {"reportId": stream_slice.get("report_id")}

def stream_slices(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladimir-remar could you help me to understand this part

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, since those reports are not created or scheduled, instead of use _report_data normal functionability I've modify to read report_id from slices which contains the report_id generate by Amazon, I did that in order to not modify the actual behavior in read_records method and make it compatible with other streams.

report_id = self._create_report(sync_mode, cursor_field, stream_slice, stream_state)["reportId"]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vladimir-remar I don't think it's right way to use the stream_slices here. @marcosmarxm do you have any suggestions here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the main usability for stream slices, but if it's solving the problem I don't see way not use it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also probably would be good to implement a unit test mocking the request but making clear what this function is doing.


return {"reportId": stream_slice.get("report_id")}

def stream_slices(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the main usability for stream slices, but if it's solving the problem I don't see way not use it.

```
"""

strict_start_date = pendulum.now("utc").subtract(days=90)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why the strict start date? Also update the connector documentation explaining for this report won't follow the start date in spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, That strict limit comes from documentation:

createdSince
The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days.

For testing porpuses if a date is less than 90 days ago the status from response is 400.


return {"reportId": stream_slice.get("report_id")}

def stream_slices(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also probably would be good to implement a unit test mocking the request but making clear what this function is doing.

@marcosmarxm marcosmarxm added internal and removed bounty bounty-S Maintainer program: claimable small bounty PR labels Jul 5, 2022
@harshithmullapudi
Copy link
Contributor

Hey @vladimir-remar could you help on those changes Marcos requested?

@vladimir-remar
Copy link
Contributor Author

Thanks for your patience, I will check it ASAP.

@harshithmullapudi
Copy link
Contributor

harshithmullapudi commented Jul 15, 2022

/test connector=connectors/source-amazon-seller-partner

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2675363392
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2675363392
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        77      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/tests/test_incremental.py       121     25    79%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_core.py              294    106    64%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  960    246    74%
Name                                        Stmts   Miss  Cover
---------------------------------------------------------------
source_amazon_seller_partner/spec.py           23      0   100%
source_amazon_seller_partner/__init__.py        2      0   100%
source_amazon_seller_partner/constants.py      37      1    97%
source_amazon_seller_partner/source.py         49     10    80%
source_amazon_seller_partner/streams.py       466    215    54%
source_amazon_seller_partner/auth.py           61     36    41%
---------------------------------------------------------------
TOTAL                                         638    262    59%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestBasicRead.test_read because not found in the config
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestFullRefresh.test_sequential_reads because not found in the config
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config
======================== 17 passed, 3 skipped in 5.76s =========================

@harshithmullapudi
Copy link
Contributor

harshithmullapudi commented Jul 15, 2022

/publish connector=connectors/source-amazon-seller-partner

🕑 Publishing the following connectors:
connectors/source-amazon-seller-partner
https://github.com/airbytehq/airbyte/actions/runs/2675411277


Connector Did it publish? Were definitions generated?
connectors/source-amazon-seller-partner

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@harshithmullapudi harshithmullapudi merged commit 00c3ec7 into airbytehq:master Jul 15, 2022
jsrcodes added a commit to jsrcodes/airbyte that referenced this pull request Jul 15, 2022
…rbytehq-master

* 'master' of https://github.com/airbytehq/airbyte: (1141 commits)
  pass USE_STREAM_CAPABLE_STATE env var to containers/deployments (airbytehq#14737)
  Bump mqtt connector (airbytehq#14648)
  Add error code to ManualOperationResult (airbytehq#14657)
  Bump elasticsearch version (airbytehq#14640)
  Ryan/sync oracle version number (airbytehq#14736)
  Fixed linter issue with add_fields.py comments (airbytehq#14742)
  🎉Redshift, Databricks, Snowflake, S3 Destinations: Make S3 output filename configurable (airbytehq#14494)
  🐛Source-mssql: aligned regular and cdc syncs and its datatype tests (airbytehq#14379)
  🎉 Source Amazon Seller Partner: Add new streams (airbytehq#13604)
  bump source-file-secure (airbytehq#14704)
  🎉 New source: Timely airbytehq#13292 (airbytehq#14335)
  🪟🔧 Refactor feature service (airbytehq#14559)
  [low code cdk] add a transformation for adding fields into an outgoing record (airbytehq#14638)
  Bump destination-postgres to 0.3.21 (airbytehq#14479)
  Remove `additionalProperties: false` from JDBC destination connectors (airbytehq#14618)
  🎉 Source Notion: add OAuth authorization for source-notion connector (airbytehq#14706)
  Use the configuration diff calculation in the update endpoint (airbytehq#14626)
  🪟 🐛 Fix input validation on blur and cleanup signup error handling (airbytehq#14724)
  lower sleep after wait for successful job (airbytehq#14725)
  Add configuration diff (airbytehq#14603)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants