Skip to content

vestwell/dbt_zendesk_source

 
 

Repository files navigation

Apache License

Zendesk Support (Source)

This package models Zendesk Support 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 Zendesk Support transformation 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 ticket table's ID column is renamed ticket_id.

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/zendesk_source
    version: [">=0.6.0", "<0.7.0"]

Configuration

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

# dbt_project.yml

...
config-version: 2

vars:
    zendesk_schema: your_schema_name
    zendesk_database: your_database_name

Adding Passthrough Columns

This package includes all source columns defined in the staging models. However, the stg_zendesk__ticket model allows for additional columns to be added using a pass-through column variable. This is extremely useful if you'd like to include custom fields to the package.

# dbt_project.yml

...
vars:
  zendesk__ticket_passthrough_columns: [account_custom_field_1, account_custom_field_2]

Changing the Build Schema

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

# dbt_project.yml

...
models:
    zendesk_source:
        +schema: my_new_schema_name

Disabling Models

This package takes into consideration that not every Zendesk account utilizes the schedule, domain_name, user_tag, organization_tag, or ticket_form_history features, and allows you to disable the corresponding functionality. By default, all variables' values are assumed to be true. Add variables for only the tables you want to disable:

# dbt_project.yml

...
vars:
    using_schedules:            False         #Disable if you are not using schedules
    using_domain_names:         False         #Disable if you are not using domain names
    using_user_tags:            False         #Disable if you are not using user tags
    using_ticket_form_history:  False         #Disable if you are not using ticket form history
    using_organization_tags:    False         #Disable if you are not using organization tags

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.

Resources:

  • Find all of Fivetran's pre-built dbt packages in our dbt hub
  • Provide feedback on our existing dbt packages or what you'd like to see next
  • Learn more about Fivetran here
  • Check out Fivetran's blog
  • Learn more about dbt in the docs
  • Check out Discourse for commonly asked questions and answers
  • Join the chat on Slack for live discussions and support
  • Find dbt events near you
  • Check out the blog for the latest news on dbt's development and best practices