Skip to content

🐛 Source Shopify: fix for mismatched number of tables during normalization #8597

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

Merged
merged 11 commits into from
Dec 16, 2021

Conversation

bazarnov
Copy link
Contributor

@bazarnov bazarnov commented Dec 7, 2021

What

#8353

How

  • edited scheams: orders, abandoned_checkouts, draft_orders, metafields
  • forced the DataTypeEnforcer to set string as string, in some cases.
  • renamed orders_refunds to order_refunds to avoid name conflicts during normalisation process.
  • fixed the issue, when AirbyteLogger exposes the data coming from stream_slice
  • increased the performance of order_refunds stream, by polling out refund-ready information from the order.
  • implemented re-use of shop stream in the check_connection method.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • 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
    • 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
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here

@bazarnov bazarnov self-assigned this Dec 7, 2021
@github-actions github-actions bot added the area/connectors Connector related issues label Dec 7, 2021
@sherifnada
Copy link
Contributor

@bazarnov what was the root cause for the linked issue?

@bazarnov
Copy link
Contributor Author

bazarnov commented Dec 8, 2021

@bazarnov what was the root cause for the linked issue?

There was a conflict between orders stream schema and orders_refunds stream schema.
The orders schema contains the refunds property which is the same as the whole orders_refunds schema, it's duplicating as nested structure. While creating the tables for orders_refunds there was a conflict between of two and the tables were not created properly.

@bazarnov bazarnov temporarily deployed to more-secrets December 13, 2021 14:28 Inactive
@bazarnov
Copy link
Contributor Author

bazarnov commented Dec 14, 2021

/test connector=connectors/source-shopify

🕑 connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1577396628
✅ connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1577396628
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        76      8    89%
	 source_acceptance_test/conftest.py                     109    109     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              235     95    60%
	 source_acceptance_test/tests/test_full_refresh.py       38     27    29%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  54     24    56%
	 source_acceptance_test/utils/compare.py                 62     25    60%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  946    442    53%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_shopify/__init__.py        2      2     0%
	 -------------------------------------------------/actions-runner/_work/airbyte/airbyte/airbyte-integrations/connectors/source-shopify/.venv/lib/python3.8/site-packages/coverage/control.py:768: CoverageWarning: No data was collected. (no-data-collected)
	 source_shopify/auth.py           20     20     0%
	 source_shopify/source.py        249    249     0%
	 source_shopify/transform.py      58     58     0%
	 source_shopify/utils.py          57     57     0%
	 -------------------------------------------------
	 TOTAL                           386    386     0%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_shopify/__init__.py        2      0   100%
	 source_shopify/auth.py           20     11    45%
	 source_shopify/source.py        249    101    59%
	 source_shopify/transform.py      58      3    95%
	 source_shopify/utils.py          57      6    89%
	 -------------------------------------------------
	 TOTAL                           386    121    69%

@jrhizor jrhizor temporarily deployed to more-secrets December 14, 2021 10:42 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Dec 14, 2021
@bazarnov
Copy link
Contributor Author

bazarnov commented Dec 14, 2021

/test connector=connectors/source-shopify

🕑 connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1577938332
✅ connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1577938332
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        76      8    89%
	 source_acceptance_test/conftest.py                     109    109     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              235     95    60%
	 source_acceptance_test/tests/test_full_refresh.py       38     27    29%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  54     24    56%
	 source_acceptance_test/utils/compare.py                 62     25    60%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  946    442    53%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_shopify/__init__.py        2      2     0%
	 source_shopify/auth.py           20     20     0%
	 source_shopify/source.py        250    250     0%
	 source_shopify/transform.py      58     58     0%
	 source_shopify/utils.py          57     57     0%
	 -------------------------------------------------
	 TOTAL                           387    387     0%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_shopify/__init__.py        2      0   100%
	 source_shopify/auth.py           20     11    45%
	 source_shopify/source.py        250    102    59%
	 source_shopify/transform.py      58      3    95%
	 source_shopify/utils.py          57      6    89%
	 -------------------------------------------------
	 TOTAL                           387    122    68%

@bazarnov bazarnov temporarily deployed to more-secrets December 14, 2021 13:04 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets December 14, 2021 13:05 Inactive
Copy link
Contributor

@antixar antixar left a comment

Choose a reason for hiding this comment

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

Names of 2 streams were changed. will it be able to break exist user syncs?
Can we keep old ones? Or create new streams separately or add names' aliases

@bazarnov
Copy link
Contributor Author

Names of 2 streams were changed. will it be able to break exist user syncs? Can we keep old ones? Or create new streams separately or add names' aliases

As far as we edited the schemas, the users will have to redo the whole sync again, unfortunately. We cannot keep the old ones here.

@antixar
Copy link
Contributor

antixar commented Dec 15, 2021

Names of 2 streams were changed. will it be able to break exist user syncs? Can we keep old ones? Or create new streams separately or add names' aliases

As far as we edited the schemas, the users will have to redo the whole sync again, unfortunately. We cannot keep the old ones here.
@bazarnov ,
Please add comment about this possible problems with old streams and obvious errors as log message for end users. With a short instruction how they have to migrate to the new ones. Maybe add a link to this PR where will be more details

@bazarnov bazarnov temporarily deployed to more-secrets December 16, 2021 12:04 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets December 16, 2021 12:05 Inactive
@bazarnov
Copy link
Contributor Author

bazarnov commented Dec 16, 2021

/test connector=connectors/source-shopify

🕑 connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1587391227
✅ connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1587391227
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        76      8    89%
	 source_acceptance_test/conftest.py                     109    109     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              235     95    60%
	 source_acceptance_test/tests/test_full_refresh.py       38     27    29%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  54     24    56%
	 source_acceptance_test/utils/compare.py                 62     25    60%
	 source_acceptance_test/utils/connector_runner.py       101     65    36%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  965    458    53%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	   self._warn("No data was collected.", slug="no-data-collected")
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_shopify/__init__.py        2      2     0%
	 source_shopify/auth.py           20     20     0%
	 source_shopify/source.py        250    250     0%
	 source_shopify/transform.py      58     58     0%
	 source_shopify/utils.py          57     57     0%
	 -------------------------------------------------
	 TOTAL                           387    387     0%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                          Stmts   Miss  Cover
	 -------------------------------------------------
	 source_shopify/__init__.py        2      0   100%
	 source_shopify/auth.py           20     11    45%
	 source_shopify/source.py        250    102    59%
	 source_shopify/transform.py      58      3    95%
	 source_shopify/utils.py          57      6    89%
	 -------------------------------------------------
	 TOTAL                           387    122    68%

@bazarnov bazarnov temporarily deployed to more-secrets December 16, 2021 12:15 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets December 16, 2021 12:16 Inactive
Copy link
Contributor

@antixar antixar left a comment

Choose a reason for hiding this comment

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

LGTM!
Please publish your changes

@bazarnov
Copy link
Contributor Author

bazarnov commented Dec 16, 2021

/publish connector=connectors/source-shopify

🕑 connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1587550260
✅ connectors/source-shopify https://github.com/airbytehq/airbyte/actions/runs/1587550260

@jrhizor jrhizor temporarily deployed to more-secrets December 16, 2021 13:00 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets December 16, 2021 13:48 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets December 16, 2021 15:21 Inactive
@bazarnov bazarnov merged commit fb834c9 into master Dec 16, 2021
@bazarnov bazarnov deleted the bazarnov/8353-shopify-normalization-issue branch December 16, 2021 15:50
schlattk pushed a commit to schlattk/airbyte that referenced this pull request Jan 4, 2022
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
Projects
None yet
5 participants