Skip to content
Merged
52 changes: 29 additions & 23 deletions .github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
## PR Overview
**This PR will address the following Issue/Feature:**
<!--
Pre-Submission Reminders
Before marking this PR as "ready for review":

**This PR will result in the following new package version:**
<!--- Please add details around your decision for breaking vs non-breaking version upgrade. If this is a breaking change, were backwards-compatible options explored? -->
- `dbt run --full-refresh && dbt test`
- `dbt run` && `dbt test` (if incremental models are present)
- The related issue is linked, tagged, and appropriately assigned
- Documentation and version updates are included, if applicable
- `docs` have been regenerated (unless there are no code or YAML changes)
- BuildKite integration tests are passing
-->

**Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:**
<!--- Copy/paste the CHANGELOG for this version below. -->
## PR Overview
**Package version introduced in this PR:**

**This PR addresses the following Issue/Feature(s):**
<!-- Add Issue # or internal ticket reference -->

## PR Checklist
### Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
- [ ] dbt run –full-refresh && dbt test
- [ ] dbt run (if incremental models are present) && dbt test
**Summary of changes:**
<!-- 1-2 sentences describing PR changes. -->

Before marking this PR as "ready for review" the following have been applied:
- [ ] The appropriate issue has been linked, tagged, and properly assigned
- [ ] All necessary documentation and version upgrades have been applied
- [ ] docs were regenerated (unless this PR does not include any code or yml updates)
- [ ] BuildKite integration tests are passing
- [ ] Detailed validation steps have been provided below

### Detailed Validation
Please share any and all of your validation steps:
<!--- Provide the steps you took to validate your changes below. -->
### Submission Checklist
- [ ] Alignment meeting with the reviewer (if needed)
- [ ] Timeline and validation requirements discussed
- [ ] Provide validation details:
- [ ] **Validation Steps:** Check for unintentional effects (e.g., add/run consistency & integrity tests)
- [ ] **Testing Instructions:** Confirm the change addresses the issue(s)
- [ ] **Focus Areas:** Complex logic or queries that need extra attention

### If you had to summarize this PR in an emoji, which would it be?
<!--- For a complete list of markdown compatible emojis check our this git repo (https://gist.github.com/rxaviers/7360908) -->
:dancer:
### Changelog
<!-- Recommend drafting changelog notes, then refining via ChatGPT using:
"Draft a changelog entry based on the following notes." -->
- [ ] Draft changelog for PR
- [ ] Final changelog for release review
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# dbt_netsuite_source v0.13.1

This release introduces the following updates:

## Feature Update
- Added pass through columns functionality to the `stg_netsuite__accounting_periods` and `stg_netsuite2__accounting_periods` models using a new `accounting_periods_pass_through_columns` variable. This allows users to pass through additional columns from the source accounting periods tables ([PR #62](https://github.com/fivetran/dbt_netsuite_source/pull/62) and [#63](https://github.com/fivetran/dbt_netsuite_source/pull/63))
- See [README](https://github.com/fivetran/dbt_netsuite_source?tab=readme-ov-file#passing-through-additional-fields) for more details.
> Note: Columns specified by `accounting_periods_pass_through_columns` are not currently persisted downstream to Netsuite transform models. Please open an [issue](https://github.com/fivetran/dbt_netsuite/issues) on the `dbt_netsuite` repository if you would like to see accounting period custom columns persisted downstream.

## Under the Hood
- Updated package maintainer PR template. ([PR #63](https://github.com/fivetran/dbt_netsuite_source/pull/63))

## Contributors
- [@atharv6](https://github.com/atharv6) ([PR #62](https://github.com/fivetran/dbt_netsuite_source/pull/62))

# dbt_netsuite_source v0.13.0

[PR #63](https://github.com/fivetran/dbt_netsuite_source/pull/63) includes the following updates:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright © 2025 Fivetran Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ vars:
> To determine if a table or field is activated by a feature, access the [Records Catalog](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_159367781370.html).

### (Optional) Step 6: Additional configurations
<details><summary>Expand for configurations</summary>
<details open><summary>Expand for configurations</summary>

#### Passing Through Additional Fields
This package includes all source columns defined in the macros folder. You can add more columns using our pass-through column variables. These variables allow for the pass-through fields to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables:
Expand All @@ -140,6 +140,9 @@ vars:
accounts_pass_through_columns:
- name: "new_custom_field"
alias: "custom_field"
accounting_periods_pass_through_columns:
- name: "custom_field"
transform_sql: "cast(custom_field as string)"
classes_pass_through_columns:
- name: "this_field"
departments_pass_through_columns:
Expand Down Expand Up @@ -172,6 +175,9 @@ vars:
- name: "items_custom_field"
alias: "items_field"
```

> If you would like passthrough column support for any other source tables, please create a Feature Request [issue](https://github.com/fivetran/dbt_netsuite/issues).

#### Change the build schema
By default, this package builds the Netsuite staging models within a schema titled (`<target_schema>` + `_netsuite_source`) in your destination. If this is not where you would like your netsuite staging data to be written to, add the following configuration to your root `dbt_project.yml` file:

Expand Down
3 changes: 2 additions & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
name: 'netsuite_source'
version: '0.13.0'
version: '0.13.1'

models:
netsuite_source:
Expand Down Expand Up @@ -59,6 +59,7 @@ vars:
netsuite2_entity_address: "{{ source('netsuite2', 'entity_address') }}"
netsuite2_location_main_address: "{{ source('netsuite2', 'location_main_address') }}"
accounts_pass_through_columns: []
accounting_periods_pass_through_columns: []
classes_pass_through_columns: []
departments_pass_through_columns: []
transactions_pass_through_columns: []
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'netsuite_source_integration_tests'

version: '0.13.0'
version: '0.13.1'

profile: 'integration_tests'
config-version: 2
Expand Down
4 changes: 4 additions & 0 deletions macros/get_accounting_periods_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
{"name": "year_id", "datatype": dbt.type_float()}
] %}

{{ fivetran_utils.add_pass_through_columns(columns, var('accounting_periods_pass_through_columns')) }}

{{ return(columns) }}

{% endmacro %}
Expand Down Expand Up @@ -60,6 +62,8 @@
{"name": "startdate", "datatype": dbt.type_timestamp()}
] %}

{{ fivetran_utils.add_pass_through_columns(columns, var('accounting_periods_pass_through_columns')) }}

{{ return(columns) }}

{% endmacro %}
3 changes: 3 additions & 0 deletions models/netsuite/stg_netsuite__accounting_periods.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ final as (
closed as is_closed,
_fivetran_deleted

--The below macro adds the fields defined within your accounting_periods_pass_through_columns variable into the staging model
{{ netsuite_source.fill_pass_through_columns(var('accounting_periods_pass_through_columns', [])) }}

from fields
)

Expand Down
5 changes: 5 additions & 0 deletions models/netsuite2/stg_netsuite2__accounting_periods.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ final as (
alllocked = 'T' as is_all_locked,
arlocked = 'T' as is_ar_locked,
aplocked = 'T' as is_ap_locked

--The below macro adds the fields defined within your accounting_periods_pass_through_columns variable into the staging model
{{ netsuite_source.fill_pass_through_columns(var('accounting_periods_pass_through_columns', [])) }}


from fields
where not coalesce(_fivetran_deleted, false)
)
Expand Down