Skip to content

Commit 40846a9

Browse files
Update variable declarations (#59)
* Update variable declarations * fix variable declaration * fix variable declaration * fix variable declaration * Update + regen docs * PR fixes * PR fixes * PR fixes * PR fixes * PR fixes
1 parent bd22af7 commit 40846a9

30 files changed

+70
-31
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# dbt_netsuite_source v0.11.1
2+
[PR #59](https://github.com/fivetran/dbt_netsuite_source/pull/59) includes the following updates:
3+
4+
## Macro Updates
5+
- Introduced a local version of the `fill_pass_through_columns` macro that directly calls the variables within our staging models. This removes the existing string-to-variable conversion and leads to cleaner parsing.
6+
- This new macro has no functional changes from the previous macro and will not require customers to make any changes on their end.
7+
- This new macro is applied to all staging models with passthrough column functionality, and replaces the existing `fill_pass_through_columns` macro.
8+
- `stg_netsuite` and `stg_netsuite2` models impacted include: `accounts`, `classes`, `consolidated_exchange_rates`, `customers`, `departments`, `items`, `locations`, `subsidiaries`, `transaction_lines`, `transactions`, and `vendors`.
9+
- Similar changes are being made on a simultaneous release to the `persist_pass_through_columns` macro in the `dbt_netsuite` package. [See the release notes](https://github.com/fivetran/dbt_netsuite/releases/tag/v0.17.1) for more details.
10+
- The process for adding passthrough columns remains unchanged. [Consult the README](https://github.com/fivetran/dbt_netsuite?tab=readme-ov-file#passing-through-additional-fields) for more details.
11+
12+
## Documentation Update
13+
- Moved badges at top of the README below the H1 header to be consistent with popular README formats.
14+
115
# dbt_netsuite_source v0.11.0
216
[PR #57](https://github.com/fivetran/dbt_netsuite_source/pull/57) includes the following update:
317

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<p align="center">
1+
# Netsuite Source dbt Package ([Docs](https://fivetran.github.io/dbt_netsuite_source/))
2+
3+
<p align="left">
24
<a alt="License"
35
href="https://github.com/fivetran/dbt_netsuite_source/blob/main/LICENSE">
46
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
@@ -13,7 +15,6 @@
1315
<img src="https://img.shields.io/badge/Fivetran_Quickstart_Compatible%3F-yes-green.svg" /></a>
1416
</p>
1517

16-
# Netsuite Source dbt Package ([Docs](https://fivetran.github.io/dbt_netsuite_source/))
1718
## What does this dbt package do?
1819
<!--section="netsuite_source_model"-->
1920
- Materializes [Netsuite staging tables](https://fivetran.github.io/dbt_netsuite_source/#!/overview/netsuite_source/models/?g_v=1&g_e=seeds) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/netsuite#schemainformation). These staging tables clean, test, and prepare your Netsuite data from [Fivetran's connector](https://fivetran.com/docs/applications/netsuite) for analysis by doing the following:

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
config-version: 2
22
require-dbt-version: [">=1.3.0", "<2.0.0"]
33
name: 'netsuite_source'
4-
version: '0.11.0'
4+
version: '0.11.1'
55

66
models:
77
netsuite_source:

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

integration_tests/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'netsuite_source_integration_tests'
22

3-
version: '0.11.0'
3+
version: '0.11.1'
44

55
profile: 'integration_tests'
66
config-version: 2

macros/fill_pass_through_columns.sql

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% macro fill_pass_through_columns(pass_through_variable) %}
2+
3+
{{ adapter.dispatch('fill_pass_through_columns', 'netsuite_source') (pass_through_variable) }}
4+
5+
{%- endmacro %}
6+
7+
{% macro default__fill_pass_through_columns(pass_through_variable) %}
8+
9+
{% if pass_through_variable %}
10+
{% for field in pass_through_variable %}
11+
{% if field is mapping %}
12+
{% if field.transform_sql %}
13+
, {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}
14+
{% else %}
15+
, {{ field.alias if field.alias else field.name }}
16+
{% endif %}
17+
{% else %}
18+
, {{ field }}
19+
{% endif %}
20+
{% endfor %}
21+
{% endif %}
22+
23+
{% endmacro %}

models/netsuite/stg_netsuite__accounts.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final as (
4141
_fivetran_deleted
4242

4343
--The below macro adds the fields defined within your accounts_pass_through_columns variable into the staging model
44-
{{ fivetran_utils.fill_pass_through_columns('accounts_pass_through_columns') }}
44+
{{ netsuite_source.fill_pass_through_columns(var('accounts_pass_through_columns', [])) }}
4545

4646
from fields
4747
)

models/netsuite/stg_netsuite__classes.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final as (
3535
_fivetran_deleted
3636

3737
--The below macro adds the fields defined within your classes_pass_through_columns variable into the staging model
38-
{{ fivetran_utils.fill_pass_through_columns('classes_pass_through_columns') }}
38+
{{ netsuite_source.fill_pass_through_columns(var('classes_pass_through_columns', [])) }}
3939

4040
from fields
4141
)

models/netsuite/stg_netsuite__consolidated_exchange_rates.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final as (
4141
_fivetran_deleted
4242

4343
--The below macro adds the fields defined within your consolidated_exchange_rates_pass_through_columns variable into the staging model
44-
{{ fivetran_utils.fill_pass_through_columns('consolidated_exchange_rates_pass_through_columns') }}
44+
{{ netsuite_source.fill_pass_through_columns(var('consolidated_exchange_rates_pass_through_columns', [])) }}
4545

4646
from fields
4747
)

0 commit comments

Comments
 (0)