diff --git a/connectors/source_shopify/README.md b/connectors/source_shopify/README.md index 2181ffd5..d33afe78 100644 --- a/connectors/source_shopify/README.md +++ b/connectors/source_shopify/README.md @@ -1,9 +1,86 @@ -# Airbyte source_shopify dbt Package +# Shopify Airbyte dbt Package -This package contains dbt models for Airbyte source_shopify source. +--- -What it includes: +- This package contains dbt models to work with Airbyte Shopify connector. +- The package is compatible with latest version of Airbyte Shopify connector. +- Currently, it is limited to creating transformations compatible with [Fivetran's modeling dbt package](https://github.com/fivetran/dbt_shopify/tree/main). +- In the future, specific models will be applied directly to Airbyte connector output. If you have an idea or want to propose an analytical model for this source, please refer to the contributing guide, which explains how to propose a new transformation model. +- This package was tested with BigQuery, Snowflake, and Postgres data warehouses. + +--- + +## 🎯 Intructions how to use + +### Airbyte dbt Package + +For now Airbyte dbt packages aren't versioned. You must configure using git and subdirectory. For now there isn't any transformation model directly applied to this package. But you can generate docs and tests with dbt. + +Create the following files: + +**`dbt_project.yml`** + +```yaml +vars: + using_fivetran_model: False + airbyte_database: "airbyte_db_default" + airbyte_schema: "airbyte_dbt_shopify" +``` + +**`packages.yml`** + +```yaml +packages: + - git: "https://github.com/airbytehq/airbyte-dbt-models.git" + subdirectory: "connectors/source_shopify" +``` + +After you can run `dbt tests` or `dbt docs generate` to have a preview of Airbyte output data. + +### Fivetran Zendesk Modeling dbt package + +This package transforms Airbyte connector output data, making it compatible with Fivetran's Zendesk dbt package. You can check the analytical models Fivetran creates [here](https://github.com/fivetran/dbt_zendesk/tree/main?tab=readme-ov-file#-what-does-this-dbt-package-do). The link also provides information about how the package works and what is configurable. + +Create the require files to use Airbyte and Fivetran dbt packages: + +**`packages.yml`** + +```yaml +packages: + - git: "https://github.com/airbytehq/airbyte-dbt-models.git" + subdirectory: "connectors/source_shopify" + + - package: fivetran/zendesk + version: [">=0.16.0", "<0.17.0"] +``` + +This is a default variable definition you must configure to have the models created. +At the moment this package doesn't support (schedules, domains, user tags, ticket form history and organization tags) for that reason keep those variables set to `False`. +Variables starting with the prefix `shopify_..._identifier` represent the names of tables generated by the Airbyte connector. If you configured your sync with this prefix, ensure you edit it accordingly. + +**`dbt_project.yml`** + +```yaml +vars: + # Required by Airbyte dbt model + using_fivetran_model: True + airbyte_database: "airbyte_db_default" + airbyte_schema: "airbyte_dbt_shopify" + + # Required by Fivetran dbt model + shopify_database: "airbyte_db_default" + shopify_schema: "airbyte_dbt_shopify" + + # Need to work - WIP + +``` + +After run `dbt run`, you can see the models being created. + +--- + +## :package: Package Maintenance + +- This package is maintained by the Airbyte Community. +- You can contribute any time please read the Contributing Guidelines or enter the Airbyte Slack Channel `#airbyte-dbt-packages` -* A complete source description -* ERD model for the source -* Diagram documentation for the source diff --git a/connectors/source_shopify/dbt_project.yml b/connectors/source_shopify/dbt_project.yml index 2e337662..506f3020 100644 --- a/connectors/source_shopify/dbt_project.yml +++ b/connectors/source_shopify/dbt_project.yml @@ -4,7 +4,7 @@ config-version: 2 version: 0.1.0 -profile: airbyte +profile: integration_tests model-paths: - models @@ -24,7 +24,7 @@ require-dbt-version: - <2.0.0 models: - source_shopify: + airbyte_dbt_source_shopify: materialized: view staging: materialized: view diff --git a/connectors/source_shopify/integration_tests/dbt_project.yml b/connectors/source_shopify/integration_tests/dbt_project.yml new file mode 100644 index 00000000..f46d8207 --- /dev/null +++ b/connectors/source_shopify/integration_tests/dbt_project.yml @@ -0,0 +1,56 @@ +name: integration_test_shopify + +config-version: 2 + +version: 0.1.0 + +profile: integration_tests + +model-paths: + - models + +macro-paths: + - macros + +target-path: target + +clean-targets: + - target + - dbt_modules + - logs + +require-dbt-version: + - ">=1.3.0" + - <2.0.0 + +models: + airbyte_dbt_source_shopify: + materialized: view + +schema: dbt_source_shopify + staging: + materialized: view + tmp: + materialized: view + +vars: + # Required by Airbyte dbt model + using_fivetran_model: True + airbyte_database: "airbyte_db_default" + airbyte_schema: "dbt_source_shopify" + + # Required by Fivetran dbt model + shopify_database: "airbyte_db_default" + shopify_schema: "dbt_source_shopify" + + shopify_customers_identifier: "customer" + shopify_customer_emails_identifier: "customer_email" + shopify_orders_identifier: "order" + shopify_products_identifier: "product" + shopify_transactions_identifier: "transactions" + shopify_discount_codes_identifier: "discount_codes" + shopify_inventory_levels_identifier: "inventory_levels" + + + + + diff --git a/connectors/source_shopify/integration_tests/package-lock.yml b/connectors/source_shopify/integration_tests/package-lock.yml new file mode 100644 index 00000000..c742dfb3 --- /dev/null +++ b/connectors/source_shopify/integration_tests/package-lock.yml @@ -0,0 +1,11 @@ +packages: + - package: fivetran/shopify_source + version: [">=0.12.0", "<0.13.0"] + - package: fivetran/fivetran_utils + version: [">=0.4.0", "<0.5.0"] + - package: dbt-labs/dbt_utils + version: [">=1.0.0", "<2.0.0"] + - package: calogica/dbt_date + version: [">=0.9.0", "<1.0.0"] + - package: dbt-labs/spark_utils + version: [">=0.3.0", "<0.4.0"] diff --git a/connectors/source_shopify/integration_tests/packages.yml b/connectors/source_shopify/integration_tests/packages.yml new file mode 100644 index 00000000..29467235 --- /dev/null +++ b/connectors/source_shopify/integration_tests/packages.yml @@ -0,0 +1,5 @@ +packages: + - local: ../ + + - package: fivetran/shopify + version: [">=1.3.0", "<2.0.0"] diff --git a/connectors/source_shopify/integration_tests/vars b/connectors/source_shopify/integration_tests/vars new file mode 100644 index 00000000..807c6128 --- /dev/null +++ b/connectors/source_shopify/integration_tests/vars @@ -0,0 +1 @@ +{airbyte_database: $AB_DB, shopify_database: $AB_DB} \ No newline at end of file diff --git a/connectors/source_shopify/models/fivetran_converter/customer_email.sql b/connectors/source_shopify/models/fivetran_converter/customer_email.sql new file mode 100644 index 00000000..e69de29b diff --git a/connectors/source_shopify/models/fivetran_converter/customer_email.yml b/connectors/source_shopify/models/fivetran_converter/customer_email.yml new file mode 100644 index 00000000..e69de29b