Skip to content

Commit

Permalink
Merge pull request #6 from fivetran/passthrough_update
Browse files Browse the repository at this point in the history
Passthrough fields update
  • Loading branch information
fivetran-joemarkiewicz authored Dec 1, 2020
2 parents 449ad2a + 9014fb6 commit aaa8c49
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 36 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ This package includes all source columns defined in the `generate_columns.sql` m
...
vars:
github_source:
issue_assignee_pass_through_columns: [issue_assignee_custom_field_1, issue_assignee_custom_field_2]
issue_closed_history_pass_through_columns: [my_issue_closed_history_custom_field]
issue_comment_pass_through_columns: [issues_comment_on_custom_fields_too]
issue_label_pass_through_columns: [label_issues_with_this_column, label_maker_column, woohoo_im_a_column_too]
issue_comment_pass_through_columns: [issue_comment_body, issue_comment_created_at]
issue_merged_pass_through_columns: [issue_merged_commit_sha, issue_merged_actor_id]
issue_pass_through_columns: [cool_custom_issue_field, im_an_issue_too]
pull_request_review_pass_through_columns: [pull_request_review_body]
pull_request_pass_through_columns: [pull_request_base_label, pull_request_head_ref]
repository_pass_through_columns: [repository_language, repository_fork, repository_description]
requested_reviewer_history_pass_through_columns: [requested_reviewer_history_actor]
user_pass_through_columns: [user_hireable, one_more_user_field, im_the_last_user_field]
```

## Database support
Expand Down
6 changes: 2 additions & 4 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2

name: 'github_source'
version: '0.1.0'
version: '0.2.0'

require-dbt-version: [">=0.18.0", "<0.19.0"]

Expand All @@ -24,12 +24,10 @@ vars:
repository: "{{ source('github', 'repository') }}"
requested_reviewer_history: "{{ source('github', 'requested_reviewer_history') }}"
user: "{{ source('github', 'user') }}"
issue_assignee_pass_through_columns: []
issue_closed_history_pass_through_columns: []
issue_comment_pass_through_columns: []
issue_label_pass_through_columns: []
issue_merged_pass_through_columns: []
issue_pass_through_columns: []
issue_pass_through_columns: []
pull_request_review_pass_through_columns: []
pull_request_pass_through_columns: []
repository_pass_through_columns: []
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'github_source_integration_tests'
version: '0.1.0'
version: '0.2.0'
config-version: 2

profile: 'integration_tests'
Expand Down
14 changes: 0 additions & 14 deletions models/stg_github__issue_assignee.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,13 @@ with issue_assignee as (
)
}}

--The below script allows for pass through columns.
{% if var('issue_assignee_pass_through_columns') %}
,
{{ var('issue_assignee_pass_through_columns') | join (", ")}}

{% endif %}
from issue_assignee

), fields as (

select
issue_id,
user_id

--The below script allows for pass through columns.
{% if var('issue_assignee_pass_through_columns') %}
,
{{ var('issue_assignee_pass_through_columns') | join (", ")}}

{% endif %}

from macro
)

Expand Down
14 changes: 0 additions & 14 deletions models/stg_github__issue_label.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,13 @@ with issue_label as (
)
}}

--The below script allows for pass through columns.
{% if var('issue_label_pass_through_columns') %}
,
{{ var('issue_label_pass_through_columns') | join (", ")}}

{% endif %}
from issue_label

), fields as (

select
issue_id,
label

--The below script allows for pass through columns.
{% if var('issue_label_pass_through_columns') %}
,
{{ var('issue_label_pass_through_columns') | join (", ")}}

{% endif %}

from macro
)

Expand Down

0 comments on commit aaa8c49

Please sign in to comment.