From 3cf2a6190e2a713b8bd0705b2d16198a5a998315 Mon Sep 17 00:00:00 2001 From: fivetran-kristin Date: Fri, 22 May 2020 16:05:51 -0700 Subject: [PATCH] updating source package --- README.md | 2 +- dbt_project.yml | 16 +++++++++++++++- models/stg_github_issue.sql | 2 +- models/stg_github_issue_assignee.sql | 2 +- models/stg_github_issue_closed_history.sql | 3 +-- models/stg_github_issue_comment.sql | 2 +- models/stg_github_issue_label.sql | 2 +- models/stg_github_issue_merged.sql | 2 +- models/stg_github_pull_request.sql | 2 +- models/stg_github_pull_request_review.sql | 2 +- models/stg_github_repository.sql | 2 +- models/stg_github_requested_reviewer_history.sql | 2 +- models/stg_github_user.sql | 2 +- 13 files changed, 27 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 12cd511..0fa8657 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This package models GitHub data from [Fivetran's connector](https://fivetran.com/docs/applications/GitHub). It uses data in the format described by [this ERD](https://docs.google.com/presentation/d/1lx6ez7-x-s-n2JCnCi3SjG4XMmx9ysNUvaNCaWc3I_I/edit). -This package is designed to do the following: +This package is designed enrich your Fivetran data by doing the following: * Add descriptions to tables and columns that are synced using Fivetran * Add freshness tests to source data * Add column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values. diff --git a/dbt_project.yml b/dbt_project.yml index 28d3af3..1c52b51 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -7,4 +7,18 @@ require-dbt-version: [">=0.17.0", "<0.18.0"] models: github_source: - materialized: ephemeral \ No newline at end of file + materialized: ephemeral + +vars: + github_source: + issue_assignee: "{{ source('github', 'issue_assignee') }}" + issue_closed_history: "{{ source('github', 'issue_closed_history') }}" + issue_comment: "{{ source('github', 'issue_comment') }}" + issue_label: "{{ source('github', 'issue_label') }}" + issue_merged: "{{ source('github', 'issue_merged') }}" + issue: "{{ source('github', 'issue') }}" + pull_request_review: "{{ source('github', 'pull_request_review') }}" + pull_request: "{{ source('github', 'pull_request') }}" + repository: "{{ source('github', 'repository') }}" + requested_reviewer_history: "{{ source('github', 'requested_reviewer_history') }}" + user: "{{ source('github', 'user') }}" diff --git a/models/stg_github_issue.sql b/models/stg_github_issue.sql index 2aeedc8..ba1ffb1 100644 --- a/models/stg_github_issue.sql +++ b/models/stg_github_issue.sql @@ -1,7 +1,7 @@ with issue as ( select * - from {{ source('github', 'issue') }} + from {{ var('issue') }} ), fields as ( diff --git a/models/stg_github_issue_assignee.sql b/models/stg_github_issue_assignee.sql index 78abfdf..fecb9f5 100644 --- a/models/stg_github_issue_assignee.sql +++ b/models/stg_github_issue_assignee.sql @@ -1,7 +1,7 @@ with issue_assignee as ( select * - from {{ source('github', 'issue_assignee') }} + from {{ var('issue_assignee') }} ), fields as ( diff --git a/models/stg_github_issue_closed_history.sql b/models/stg_github_issue_closed_history.sql index 3436b08..f23a8b4 100644 --- a/models/stg_github_issue_closed_history.sql +++ b/models/stg_github_issue_closed_history.sql @@ -1,9 +1,8 @@ with issue_closed_history as ( select * - from {{ source('github', 'issue_closed_history') }} + from {{ var('issue_closed_history') }} -), fields as ( select issue_id, diff --git a/models/stg_github_issue_comment.sql b/models/stg_github_issue_comment.sql index dcb78cc..a616682 100644 --- a/models/stg_github_issue_comment.sql +++ b/models/stg_github_issue_comment.sql @@ -1,7 +1,7 @@ with issue_comment as ( select * - from {{ source('github', 'issue_comment') }} + from {{ var('issue_comment') }} ), fields as ( diff --git a/models/stg_github_issue_label.sql b/models/stg_github_issue_label.sql index d2addf1..44bde3c 100644 --- a/models/stg_github_issue_label.sql +++ b/models/stg_github_issue_label.sql @@ -1,7 +1,7 @@ with issue_label as ( select * - from {{ source('github', 'issue_label') }} + from {{ var('issue_label') }} ), fields as ( diff --git a/models/stg_github_issue_merged.sql b/models/stg_github_issue_merged.sql index 925125e..ca57950 100644 --- a/models/stg_github_issue_merged.sql +++ b/models/stg_github_issue_merged.sql @@ -1,7 +1,7 @@ with issue_merged as ( select * - from {{ source('github', 'issue_merged') }} + from {{ var('issue_merged') }} ), fields as ( diff --git a/models/stg_github_pull_request.sql b/models/stg_github_pull_request.sql index d198272..7d0a8d8 100644 --- a/models/stg_github_pull_request.sql +++ b/models/stg_github_pull_request.sql @@ -1,7 +1,7 @@ with pull_request as ( select * - from {{ source('github', 'pull_request') }} + from {{ var('pull_request') }} ), fields as ( diff --git a/models/stg_github_pull_request_review.sql b/models/stg_github_pull_request_review.sql index f639ac5..ab9eef6 100644 --- a/models/stg_github_pull_request_review.sql +++ b/models/stg_github_pull_request_review.sql @@ -1,7 +1,7 @@ with pull_request_review as ( select * - from {{ source('github', 'pull_request_review') }} + from {{ var('pull_request_review') }} ), fields as ( diff --git a/models/stg_github_repository.sql b/models/stg_github_repository.sql index fa95ac3..952dc60 100644 --- a/models/stg_github_repository.sql +++ b/models/stg_github_repository.sql @@ -1,7 +1,7 @@ with repository as ( select * - from {{ source('github', 'repository') }} + from {{ var('repository') }} ), fields as ( diff --git a/models/stg_github_requested_reviewer_history.sql b/models/stg_github_requested_reviewer_history.sql index e036389..7d4d8a2 100644 --- a/models/stg_github_requested_reviewer_history.sql +++ b/models/stg_github_requested_reviewer_history.sql @@ -1,7 +1,7 @@ with requested_reviewer_history as ( select * - from {{ source('github', 'requested_reviewer_history') }} + from {{ var('requested_reviewer_history') }} ), fields as ( diff --git a/models/stg_github_user.sql b/models/stg_github_user.sql index ccf480f..fa73dc5 100644 --- a/models/stg_github_user.sql +++ b/models/stg_github_user.sql @@ -1,7 +1,7 @@ with github_user as ( select * - from {{ source('github', 'user') }} + from {{ var('user') }} ), fields as (