Git Product home page Git Product logo

dbt_shopify_source's Introduction

Shopify (Source)

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

This package enriches your Fivetran data by doing the following:

  • Adds descriptions to tables and columns that are synced using Fivetran
  • Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values.
  • Models staging tables, which will be used in our transform package

Models

This package contains staging models, designed to work simultaneously with our Shopify modeling package. The staging models name columns consistently across all packages:

  • Boolean fields are prefixed with is_ or has_
  • Timestamps are appended with _at
  • ID primary keys are prefixed with the name of the table. For example, the campaign table's ID column is renamed campaign_id.

Installation Instructions

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

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_schema: ['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

This package includes all source columns defined in the staging_columns.sql macro. To add additional columns to this package, do so using our pass-through column variables. This is extremely useful if you'd like to include custom fields to the package.

# dbt_project.yml

...
config-version: 2

vars:
  shopify_source:
    customer_pass_through_columns: []
    order_line_refund_pass_through_columns: []
    order_line_pass_through_columns: []
    order_pass_through_columns: []
    product_pass_through_columns: []
    product_variant_pass_through_columns: []

Changing the Build Schema

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

# dbt_project.yml

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

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.

Resources:

dbt_shopify_source's People

Contributors

dylanbaker avatar fivetran-joemarkiewicz avatar kristin-bagnall avatar martinguindon avatar fivetran-chloe avatar bthomson22 avatar

Watchers

James Cloos 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.