Giter Club home page Giter Club logo

dbt_shopify's Introduction

Apache License dbt logo and version

Shopify

This package models Shopify data from Fivetran's connector. It uses data in the format described by this ERD.

The main focus of the package is to transform the core object tables into analytics-ready models, including a cohort model to understand how your customers are behaving over time.

Models

This package contains transformation models, designed to work simultaneously with our Shopify source package. A dependency on the source package is declared in this package's packages.yml file, so it will automatically download when you run dbt deps. The primary outputs of this package are described below.

model description
shopify__customer_cohorts Each record represents the monthly performance of a customer, including fields for the month of their 'cohort'.
shopify__customers Each record represents a customer, with additional dimensions like lifetime value and number of orders.
shopify__orders Each record represents an order, with additional dimensions like whether it is a new or repeat purchase.
shopify__order_lines Each record represents an order line item, with additional dimensions like how many items were refunded.
shopify__products Each record represents a product, with additional dimensions like most recent order date and order volume.
shopify__transactions Each record represents a transaction with additional calculations to handle exchange rates.

Installation Instructions

Check dbt Hub for the latest installation instructions, or read the dbt docs for more information on installing packages.

Include in your packages.yml

packages:
  - package: fivetran/shopify
    version: [">=0.5.0", "<0.6.0"]

Configuration

By default, this package looks for your Shopify data in the shopify schema of your target database. If this is not where your Shopify data is, add the following configuration to your dbt_project.yml file:

# dbt_project.yml

...
config-version: 2

vars:
    shopify_database: your_database_name
    shopify_schema: your_schema_name

If you have multiple Shopify connectors in Fivetran and would like to use this package on all of them simultaneously, we have provided functionality to do so. The package will union all of the data together and pass the unioned table into the transformations. You will be able to see which source it came from in the source_relation column of each model. To use this functionality, you will need to set either the union_schemas or union_databases variables:

# dbt_project.yml

...
config-version: 2

vars:
    union_schemas: ['shopify_usa','shopify_canada'] # use this if the data is in different schemas/datasets of the same database/project
    union_databases: ['shopify_usa','shopify_canada'] # use this if the data is in different databases/projects but uses the same schema name

Changing the Build Schema

By default this package will build the Shopify staging models within a schema titled (<target_schema> + _stg_shopify) and the Shopify final models within a schema titled (<target_schema> + _shopify) in your target database. If this is not where you would like your modeled Shopify data to be written to, add the following configuration to your dbt_project.yml file:

# dbt_project.yml

...
models:
  shopify:
    +schema: my_new_schema_name # leave blank for just the target_schema
  shopify_source:
    +schema: my_new_schema_name # leave blank for just the target_schema

For additional configurations for the source models, visit the Shopify source package.

Contributions

Additional contributions to this package are very welcome! Please create issues or open PRs against master. Check out this post on the best workflow for contributing to a package.

Database support

This package has been tested on BigQuery, Snowflake, Redshift, Postgres, and Databricks.

Databricks Dispatch Configuration

dbt v0.20.0 introduced a new project-level dispatch configuration that enables an "override" setting for all dispatched macros. If you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your dbt_project.yml. This is required in order for the package to accurately search for macros within the dbt-labs/spark_utils then the dbt-labs/dbt_utils packages respectively.

# dbt_project.yml

dispatch:
  - macro_namespace: dbt_utils
    search_order: ['spark_utils', 'dbt_utils']

Resources:

dbt_shopify's People

Contributors

fivetran-joemarkiewicz avatar dylanbaker avatar kristin-bagnall avatar martinguindon avatar fivetran-chloe avatar lizdeika avatar fraserharris avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.