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 GET_XML_BROWSE_TREE_DATA report #12663

Merged

Conversation

manescianera
Copy link
Contributor

@manescianera manescianera commented May 6, 2022

What

Adds GET_XML_BROWSE_TREE_DATA report to Amazon Seller Partner source connector.

How

Get Browse Tree Report XML data and then parse it into a dictionary.

Pre-merge Checklist

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
(.venv) mcn source-amazon-seller-partner python -m pytest unit_tests
Test session starts (platform: linux, Python 3.10.4, pytest 6.2.5, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /home/mcn/projects/airbyte, configfile: pytest.ini
plugins: mock-3.7.0, sugar-0.9.4, timeout-1.4.2
collecting ...
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_reports_streams_rate_limits.py::test_reports_stream_should_retry ✓1% ▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_reports_streams_rate_limits.py::test_reports_stream_send_request ✓2% ▎         {"type": "LOG", "log": {"level": "INFO", "message": "Backing off _send_request(...) for 5.0s (airbyte_cdk.sources.streams.http.exceptions.DefaultBackoffException)"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error '' 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)"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error '' 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)"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error '' 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)"}}
{"type": "LOG", "log": {"level": "INFO", "message": "Caught retryable error '' 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)"}}

 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_reports_streams_rate_limits.py::test_reports_stream_send_request_backoff_exception ✓3% ▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_spec ✓               5% ▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams ✓            6% ▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_stream_with_good_iam_arn_value[arn:aws:iam::123456789098:user/some-user] ✓7% ▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_stream_with_good_iam_arn_value[arn:aws:iam::123456789098:role/some-role] ✓8% ▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_stream_with_bad_iam_arn_value ✓9% ▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data0-expected_data0] ✓10% █
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data1-expected_data1] ✓11% █▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data2-expected_data2] ✓12% █▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2VIGQ35RCS4UG-input_data3-expected_data3] ✓14% █▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data4-expected_data4] ✓15% █▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data5-expected_data5] ✓16% █▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data6-expected_data6] ✓17% █▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1PA6795UKMFR9-input_data7-expected_data7] ✓18% █▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data8-expected_data8] ✓19% █▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data9-expected_data9] ✓20% ██▏
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data10-expected_data10] ✓22% ██▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1C3SOZRARQ6R3-input_data11-expected_data11] ✓23% ██▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data12-expected_data12] ✓24% ██▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data13-expected_data13] ✓25% ██▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data14-expected_data14] ✓26% ██▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ARBP9OOSHTCHU-input_data15-expected_data15] ✓27% ██▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data16-expected_data16] ✓28% ██▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data17-expected_data17] ✓30% ██▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data18-expected_data18] ✓31% ███▏
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1RKKUPIHCS9HS-input_data19-expected_data19] ✓32% ███▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data20-expected_data20] ✓33% ███▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data21-expected_data21] ✓34% ███▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data22-expected_data22] ✓35% ███▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A13V1IB3VIYZZH-input_data23-expected_data23] ✓36% ███▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data24-expected_data24] ✓38% ███▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data25-expected_data25] ✓39% ███▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data26-expected_data26] ✓40% ████
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A21TJRUUN4KGV-input_data27-expected_data27] ✓41% ████▏
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data28-expected_data28] ✓42% ████▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data29-expected_data29] ✓43% ████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data30-expected_data30] ✓44% ████▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[APJ6JRA9NG5V4-input_data31-expected_data31] ✓45% ████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data32-expected_data32] ✓47% ████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data33-expected_data33] ✓48% ████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data34-expected_data34] ✓49% ████▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1805IZSGTT6HS-input_data35-expected_data35] ✓50% █████
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data36-expected_data36] ✓51% █████▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data37-expected_data37] ✓52% █████▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data38-expected_data38] ✓53% █████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A17E79C6D8DWNP-input_data39-expected_data39] ✓55% █████▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data40-expected_data40] ✓56% █████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data41-expected_data41] ✓57% █████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data42-expected_data42] ✓58% █████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2NODRKZP88ZB9-input_data43-expected_data43] ✓59% █████▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data44-expected_data44] ✓60% ██████
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data45-expected_data45] ✓61% ██████▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data46-expected_data46] ✓62% ██████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A33AVAJ2PDY3EV-input_data47-expected_data47] ✓64% ██████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data48-expected_data48] ✓65% ██████▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data49-expected_data49] ✓66% ██████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data50-expected_data50] ✓67% ██████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1F83G8C2ARO7P-input_data51-expected_data51] ✓68% ██████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data52-expected_data52] ✓69% ██████▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data53-expected_data53] ✓70% ███████▏
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data54-expected_data54] ✓72% ███████▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A39IBJ37TRP1C6-input_data55-expected_data55] ✓73% ███████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data56-expected_data56] ✓74% ███████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data57-expected_data57] ✓75% ███████▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data58-expected_data58] ✓76% ███████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1VC38T7YXB528-input_data59-expected_data59] ✓77% ███████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data60-expected_data60] ✓78% ███████▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data61-expected_data61] ✓80% ███████▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data62-expected_data62] ✓81% ████████▏
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A19VAU5U5O7RUS-input_data63-expected_data63] ✓82% ████████▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data64-expected_data64] ✓83% ████████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data65-expected_data65] ✓84% ████████▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data66-expected_data66] ✓85% ████████▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[ATVPDKIKX0DER-input_data67-expected_data67] ✓86% ████████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data68-expected_data68] ✓88% ████████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data69-expected_data69] ✓89% ████████▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data70-expected_data70] ✓90% █████████
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2Q3Y263D00KWC-input_data71-expected_data71] ✓91% █████████▏
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data72-expected_data72] ✓92% █████████▎
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data73-expected_data73] ✓93% █████████▍
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data74-expected_data74] ✓94% █████████▌
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A2EUQ1WTGCTBG2-input_data75-expected_data75] ✓95% █████████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data76-expected_data76] ✓97% █████████▋
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data77-expected_data77] ✓98% █████████▊
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data78-expected_data78] ✓99% █████████▉
 airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_transform_function.py::test_transform_seller_feedback[A1AM78C64UM0Y8-input_data79-expected_data79] ✓100% ██████████
======================================================= warnings summary =======================================================
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams
  /home/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py:105: 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(

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/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/lib/python3.10/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
airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py::test_streams
  /home/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/lib/python3.10/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()

-- Docs: https://docs.pytest.org/en/stable/warnings.html

Results (0.40s):
      88 passed
Integration
(.venv) mcn source-amazon-seller-partner python -m pytest integration_tests
Test session starts (platform: linux, Python 3.10.4, pytest 6.2.5, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /home/mcn/projects/airbyte, configfile: pytest.ini
plugins: mock-3.7.0, sugar-0.9.4, timeout-1.4.2
collecting ...

Results (0.01s):
Acceptance
(.venv) mcn source-amazon-seller-partner python -m pytest integration_tests -p integration_tests.acceptance
Test session starts (platform: linux, Python 3.10.4, pytest 6.2.5, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /home/mcn/projects/airbyte, configfile: pytest.ini
plugins: mock-3.7.0, sugar-0.9.4, timeout-1.4.2
collecting ...
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_config_match_spec[inputs0] ✓6% ▋
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_match_expected[inputs0] ✓12% █▎
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_docker_env[inputs0] ✓18% █▊
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_oneof_usage[inputs0] ✓24% ██▍
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_required[inputs0] ✓29% ██▉
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_optional[inputs0] ✓35% ███▌
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_has_secret[inputs0] ✓41% ████▎
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_secret_never_in_the_output[inputs0] ✓47% ████▊
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_defined_refs_exist_in_json_spec_file[inputs0] ✓53% █████▍
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestSpec.test_oauth_flow_parameters[inputs0] ✓59% █████▉
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestConnection.test_check[inputs0] ✓65% ██████▌
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_discover[inputs0] ✓71% ███████▏
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_cursors_exist_in_schema[inputs0] ✓76% ███████▋
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_refs_exist_in_schema[inputs0] ✓82% ████████▎
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_keyword_exist_in_schema[inputs0-allOf] ✓88% ████████▉
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_defined_keyword_exist_in_schema[inputs0-not] ✓94% █████████▌
 airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py::TestDiscovery.test_primary_keys_exist_in_schema[inputs0] ✓100% ██████████
{"type": "LOG", "log": {"level": "INFO", "message": "/home/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner - SAT run - e10f2fdcefe73a9a7a008141d7676dc9994c6f73 - PASSED"}}

=================================================== short test summary info ====================================================
SKIPPED [1] ../../bases/source-acceptance-test/source_acceptance_test/plugin.py:56: Skipping TestBasicRead.test_read because not found in the config
SKIPPED [1] ../../bases/source-acceptance-test/source_acceptance_test/plugin.py:56: Skipping TestFullRefresh.test_sequential_reads because not found in the config
SKIPPED [1] ../../bases/source-acceptance-test/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config

Results (9.24s):
      17 passed

@CLAassistant
Copy link

CLAassistant commented May 6, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels May 6, 2022
@manescianera manescianera marked this pull request as ready for review May 6, 2022 11:39
@alafanechere alafanechere self-assigned this May 12, 2022
@alafanechere
Copy link
Contributor

Hi @manescianera thank you for this contribution! I'll run the tests and go for a first review soon!

@alafanechere
Copy link
Contributor

alafanechere commented May 12, 2022

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

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2312052720
❌ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2312052720
🐛 https://gradle.com/s/yre2skdpnsddw
Python short test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestSpec::test_match_expected[inputs0] - AssertionError:...
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
=================== 1 failed, 16 passed, 3 skipped in 6.12s ====================

@alafanechere
Copy link
Contributor

alafanechere commented May 16, 2022

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

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2334373206
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2334373206
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                        75      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py        85     25    71%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  913    246    73%
Name                                        Stmts   Miss  Cover
---------------------------------------------------------------
source_amazon_seller_partner/__init__.py        2      0   100%
source_amazon_seller_partner/constants.py      37      1    97%
source_amazon_seller_partner/source.py         64      9    86%
source_amazon_seller_partner/streams.py       359    165    54%
source_amazon_seller_partner/auth.py           61     36    41%
---------------------------------------------------------------
TOTAL                                         523    211    60%

Python short 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.77s =========================

"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"browseNodeId": {
"type": ["null", "string"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": ["null", "string"]
"type": "string"

As an identifier, I'm not sure this field can be null.

"name": "GET_XML_BROWSE_TREE_DATA",
"json_schema": {
"title": "XML Browse Tree Data",
"description": "XML Browse Tree Data",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this field is redundant.

Suggested change
"description": "XML Browse Tree Data",

Comment on lines 19 to 29
"anyOf": [
{
"$ref": "#/definitions/attribute"
},
{
"type": ["array"],
"items": {
"$ref": "#/definitions/attribute"
}
}
]
Copy link
Contributor

Choose a reason for hiding this comment

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

It will make it easier for a destination to pick the right column type if you stick to arrays rather than anyOf, but this will require a small transformation in the parsing.

}
]
},
"@count": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we avoid special characters like @ for safety in case they are not supported in some destinations?

@manescianera
Copy link
Contributor Author

hey, @alafanechere ! made changes based on your review.

although looks that there's a small problem. while unit and integration tests pass no problem; after pulling from master acceptance tests fail and I'm not sure why (it passes before the pull). maybe I've missed something?

Acceptance tests
(.venv) mcn source-amazon-seller-partner python -m pytest integration_tests -p integration_tests.acceptance
Test session starts (platform: linux, Python 3.10.4, pytest 6.2.5, pytest-sugar 0.9.4)
cachedir: .pytest_cache
rootdir: /home/mcn/projects/airbyte, configfile: pytest.ini
plugins: mock-3.7.0, sugar-0.9.4, timeout-1.4.2
collecting ...
――――――――― ERROR collecting airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py ―――――――――
ImportError while importing test module '/home/mcn/projects/airbyte/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.venv/lib/python3.10/site-packages/_pytest/python.py:578: in _importtestmodule
    mod = import_path(self.fspath, mode=importmode)
.venv/lib/python3.10/site-packages/_pytest/pathlib.py:524: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
../../bases/source-acceptance-test/source_acceptance_test/tests/__init__.py:5: in <module>
    from .test_core import TestBasicRead, TestConnection, TestDiscovery, TestSpec
.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:16: in <module>
    from airbyte_cdk.models import (
E   ImportError: cannot import name 'TraceType' from 'airbyte_cdk.models' (/home/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/lib/python3.10/site-packages/airbyte_cdk/models/__init__.py)

――――― ERROR collecting airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py ―――――
ImportError while importing test module '/home/mcn/projects/airbyte/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.venv/lib/python3.10/site-packages/_pytest/python.py:578: in _importtestmodule
    mod = import_path(self.fspath, mode=importmode)
.venv/lib/python3.10/site-packages/_pytest/pathlib.py:524: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
../../bases/source-acceptance-test/source_acceptance_test/tests/__init__.py:5: in <module>
    from .test_core import TestBasicRead, TestConnection, TestDiscovery, TestSpec
.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:16: in <module>
    from airbyte_cdk.models import (
E   ImportError: cannot import name 'TraceType' from 'airbyte_cdk.models' (/home/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/lib/python3.10/site-packages/airbyte_cdk/models/__init__.py)

――――― ERROR collecting airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py ――――――
ImportError while importing test module '/home/mcn/projects/airbyte/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.venv/lib/python3.10/site-packages/_pytest/python.py:578: in _importtestmodule
    mod = import_path(self.fspath, mode=importmode)
.venv/lib/python3.10/site-packages/_pytest/pathlib.py:524: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
../../bases/source-acceptance-test/source_acceptance_test/tests/__init__.py:5: in <module>
    from .test_core import TestBasicRead, TestConnection, TestDiscovery, TestSpec
.venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py:16: in <module>
    from airbyte_cdk.models import (
E   ImportError: cannot import name 'TraceType' from 'airbyte_cdk.models' (/home/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner/.venv/lib/python3.10/site-packages/airbyte_cdk/models/__init__.py)

{"type": "LOG", "log": {"level": "INFO", "message": "/home/mcn/projects/airbyte/airbyte-integrations/connectors/source-amazon-seller-partner - SAT run - 754c2bbb632e56b3d3a2e5d11dfb80ce8bb9da57 - FAILED"}}

=================================================== short test summary info ====================================================
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_core.py
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py
FAILED ../../bases/source-acceptance-test/source_acceptance_test/tests/test_incremental.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Results (0.27s):

@alafanechere
Copy link
Contributor

alafanechere commented May 23, 2022

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

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2370433596
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2370433596
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/__init__.py        2      0   100%
source_amazon_seller_partner/constants.py      37      1    97%
source_amazon_seller_partner/source.py         64      9    86%
source_amazon_seller_partner/streams.py       365    169    54%
source_amazon_seller_partner/auth.py           61     36    41%
---------------------------------------------------------------
TOTAL                                         529    215    59%

Python short 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.65s =========================

@alafanechere
Copy link
Contributor

after pulling from master acceptance tests fail and I'm not sure why

Let's try running these in the CI (☝️ ) and to check if it's related to your environment.

}
}
},
"count": {
Copy link
Contributor

Choose a reason for hiding this comment

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

@manescianera I saw you renamed to count but I'm not sure you changed the parsing logic to rename the @count to count in the XML output. Did I miss something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

attr_prefix argument takes care of the json prefixes from parsed XML node properties, so I've changed attr_prefix to a blank string over here

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

Thank you for your changes and replies. Let's publish and merge now 🎉

@alafanechere
Copy link
Contributor

alafanechere commented May 23, 2022

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

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2370767417
🚀 Successfully published connectors/source-amazon-seller-partner
🚀 Auto-bumped version for connectors/source-amazon-seller-partner
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2370767417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants