Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pass through for customers #10

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ vars:
departments_pass_through_columns: ['department_custom_fields']
transactions_pass_through_columns: ['transactions_can_be_custom','pass_this_transaction_field_on']
transaction_lines_pass_through_columns: ['transaction_lines_field']
customers_pass_through_columns: ['customers_field']
```

### Changing the Build Schema
Expand Down
7 changes: 4 additions & 3 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 2
require-dbt-version: ">=0.20.0"

name: 'netsuite_source'
version: '0.3.1'

Expand Down Expand Up @@ -36,7 +36,8 @@ vars:
departments_pass_through_columns: []
transactions_pass_through_columns: []
transaction_lines_pass_through_columns: []

customers_pass_through_columns: []

clean-targets:
- target
- dbt_modules
- dbt_modules
15 changes: 15 additions & 0 deletions models/stg_netsuite__customers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ fields as (
)
}}

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

{% endif %}

from base
),

Expand All @@ -39,6 +46,14 @@ final as (
date_first_order as date_first_order_at,
_fivetran_deleted

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

{% endif %}


from fields
)

Expand Down