Skip to content

Commit a126283

Browse files
Feature/netsuite2 fiscal year end (#61)
* feature/netsuite2-fiscal-year-end * variable updates * seed and test updates * docs updates * pre-release versioning * changelog adjustment * version bump and docs regen * release review updates
1 parent d9e55e7 commit a126283

14 files changed

+140
-14
lines changed

.buildkite/scripts/run_models.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ dbt seed --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --t
2222
dbt compile --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db"
2323
dbt run --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db" --full-refresh
2424
dbt test --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db"
25-
dbt run --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw, netsuite2__multibook_accounting_enabled: false, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false}' --target "$db" --full-refresh
25+
dbt run --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw, netsuite2__multibook_accounting_enabled: false, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false, netsuite2__fiscal_calendar_enabled: true}' --target "$db" --full-refresh
2626
dbt test --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db"
2727

2828
else
2929

3030
dbt seed --target "$db" --full-refresh
3131
dbt run --target "$db" --full-refresh
3232
dbt test --target "$db"
33-
dbt run --vars '{netsuite2__multibook_accounting_enabled: false, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false}' --target "$db" --full-refresh
33+
dbt run --vars '{netsuite2__multibook_accounting_enabled: false, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false, netsuite2__fiscal_calendar_enabled: true}' --target "$db" --full-refresh
3434
dbt test --target "$db"
3535
fi
3636

CHANGELOG.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
# dbt_netsuite_source version.version
1+
# dbt_netsuite_source v0.12.0
2+
3+
## Breaking Schema Changes
4+
- Added optional `fiscalcalendar` source table to support accurate fiscal year start dates (currently defaulted to calendar year). This table and related models (`stg_netsuite2__fiscal_calendar_tmp` and `stg_netsuite2__fiscal_calendar`) are disabled by default. To enable this feature:
5+
- Quickstart users: enable the fiscalcalendar table in the connection schema tab.
6+
- dbt Core users: enable the fiscalcalendar table in the connection schema tab and also set the `netsuite2__fiscal_calendar_enabled` variable to true (default is false).
7+
8+
## Documentation
9+
- Corrected references to connectors and connections in the README. ([PR #60](https://github.com/fivetran/dbt_netsuite_source/pull/60))
10+
11+
# dbt_netsuite_source v0.12.0-a1
12+
13+
## Breaking Schema Changes
14+
- Added optional `fiscalcalendar` source table to support accurate fiscal year start dates (currently defaulted to calendar year). This table and related models (`stg_netsuite2__fiscal_calendar_tmp` and `stg_netsuite2__fiscal_calendar`) are disabled by default. To enable this feature:
15+
- Quickstart users: enable the fiscalcalendar table in the connection schema tab.
16+
- dbt Core users: enable the fiscalcalendar table in the connection schema tab and also set the `netsuite2__fiscal_calendar_enabled` variable to true (default is false).
217

318
## Documentation
4-
- Corrected references to connectors and connections in the README. ([#60](https://github.com/fivetran/dbt_netsuite_source/pull/60))
19+
- Corrected references to connectors and connections in the README. ([PR #60](https://github.com/fivetran/dbt_netsuite_source/pull/60))
520

621
# dbt_netsuite_source v0.11.1
722
[PR #59](https://github.com/fivetran/dbt_netsuite_source/pull/59) includes the following updates:

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ To use this dbt package, you must have At least either one Fivetran **Netsuite**
6363
- employee
6464
- entity
6565
- entityaddress
66+
- fiscalcalendar (required for non–January 1 fiscal year start)
6667
- item
6768
- job
6869
- location
@@ -91,7 +92,7 @@ If you are **not** using the [Netsuite transformation package](https://github.c
9192
```yaml
9293
packages:
9394
- package: fivetran/netsuite_source
94-
version: [">=0.11.0", "<0.12.0"]
95+
version: [">=0.12.0", "<0.13.0"]
9596
```
9697

9798
### Step 3: Define Netsuite.com or Netsuite2 Source
@@ -111,14 +112,15 @@ vars:
111112
```
112113

113114
### Step 5: Disable models for non-existent sources (Netsuite2 only)
114-
It's possible that your Netsuite connection does not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that feature in Netsuite or actively excluded some tables from your syncs. To disable the corresponding functionality in the package, you must add the relevant variables. By default, all variables are assumed to be true. Add variables for only the tables you would like to disable:
115+
It's possible that your Netsuite connection does not sync every table that this package expects. If your syncs exclude certain tables, it is because you either don't use that feature in Netsuite or actively excluded some tables from your syncs. To disable the corresponding functionality in the package, you must add the relevant variables. By default, most variables are assumed to be true with the exception of `netsuite2__fiscal_calendar_enabled`. Add variables for only the tables you would like to disable/enable respectively:
115116
```yml
116117
vars:
117118
netsuite2__multibook_accounting_enabled: false # True by default. Disable `accountingbooksubsidiary` and `accountingbook` if you are not using the Multi-Book Accounting feature
118119
netsuite2__using_exchange_rate: false #True by default. Disable `exchange_rate` if you don't utilize exchange rates. If you set this variable to false and are using the `netsuite` transformation package, ensure it is scoped globally so that the `netsuite` package can access it as well.
119120
netsuite2__using_vendor_categories: false # True by default. Disable `vendorcategory` if you don't categorize your vendors
120121
netsuite2__using_jobs: false # True by default. Disable `job` if you don't use jobs
121122
netsuite2__using_employees: false # True by default. Disable `employee` if you don't use employees.
123+
netsuite2__fiscal_calendar_enabled: true # False by default. Enable `fiscalcalendar` if you have a fiscal year starting on a month different than January.
122124

123125
```
124126

dbt_project.yml

Lines changed: 2 additions & 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.1'
4+
version: '0.12.0'
55

66
models:
77
netsuite_source:
@@ -54,6 +54,7 @@ vars:
5454
netsuite2_vendor_categories: "{{ source('netsuite2', 'vendor_category') }}"
5555
netsuite2_accounting_book_subsidiaries: "{{ source('netsuite2', 'accounting_book_subsidiaries') }}"
5656
netsuite2_accounting_period_fiscal_calendars: "{{ source('netsuite2', 'accounting_period_fiscal_calendars') }}"
57+
netsuite2_fiscal_calendar: "{{ source('netsuite2', 'fiscal_calendar') }}"
5758
netsuite2_account_types: "{{ source('netsuite2', 'account_type') }}"
5859
netsuite2_entity_address: "{{ source('netsuite2', 'entity_address') }}"
5960
netsuite2_location_main_address: "{{ source('netsuite2', 'location_main_address') }}"

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: 2 additions & 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.1'
3+
version: '0.12.0'
44

55
profile: 'integration_tests'
66
config-version: 2
@@ -47,6 +47,7 @@ vars:
4747
netsuite2_vendor_category_identifier: "netsuite2_vendor_category_data"
4848
netsuite2_accounting_book_subsidiaries_identifier: "netsuite2_accounting_book_sub_data"
4949
netsuite2_accounting_period_fiscal_calendars_identifier: "netsuite2_accounting_period_fiscal_cal_data"
50+
netsuite2_fiscal_calendar_identifier: "netsuite2_fiscal_calendar_data"
5051
netsuite2_account_type_identifier: "netsuite2_account_type_data"
5152
netsuite2_entity_address_identifier: "netsuite2_entity_address_data"
5253
netsuite2_location_main_address_identifier: "netsuite2_location_main_address_data"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
_fivetran_id,_fivetran_deleted,_fivetran_synced,accountingperiod,date_deleted,fiscalcalendar,parent
22
t6+LTClexXfChh/pMhoj1F9SpSs=,FALSE,2022-07-10 22:17:10,245,,1,244
33
hbwug8y6jPTTembEaYVZlsljZuQ=,FALSE,2022-07-10 22:17:10,252,,1,239
4-
hxkIkIIeDjsG8OgPAlvQVe9a6TE=,FALSE,2022-07-10 22:17:10,275,,1,274
5-
H00Ert0t6kQHovZX4pHHC4N4d0Y=,FALSE,2022-07-10 22:17:10,6,,1,1
6-
KI+pra1uPLFPsBHFuvT/tXCaWdg=,FALSE,2022-07-10 22:17:10,184,,1,171
7-
JIpeyH5xsYzCF0YbPKr7obXrkhA=,FALSE,2022-07-10 22:17:10,218,,1,205
4+
hxkIkIIeDjsG8OgPAlvQVe9a6TE=,FALSE,2022-07-10 22:17:10,275,,2,274
5+
H00Ert0t6kQHovZX4pHHC4N4d0Y=,FALSE,2022-07-10 22:17:10,6,,2,1
6+
KI+pra1uPLFPsBHFuvT/tXCaWdg=,FALSE,2022-07-10 22:17:10,20,,3,171
7+
JIpeyH5xsYzCF0YbPKr7obXrkhA=,FALSE,2022-07-10 22:17:10,21,,3,205
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
id,externalid,fiscalmonth,isdefault,name,_fivetran_deleted,date_deleted,_fivetran_synced
2+
1,,JAN,true,Calendar Year,false,,2022-05-27 13:00:58
3+
2,,APR,false,April Fiscal Year,false,,2022-05-27 13:00:58
4+
3,,CAL,false,Incorrectly Formed Month Abbreviation,false,,2022-05-27 13:00:58

macros/get_fiscalcalendar_columns.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% macro get_fiscalcalendar_columns() %}
2+
3+
{% set columns = [
4+
{"name": "id", "datatype": dbt.type_int()},
5+
{"name": "externalid", "datatype": dbt.type_string()},
6+
{"name": "fiscalmonth", "datatype": dbt.type_string()},
7+
{"name": "isdefault", "datatype": dbt.type_string()},
8+
{"name": "name", "datatype": dbt.type_string()},
9+
{"name": "_fivetran_deleted", "datatype": "boolean"},
10+
{"name": "date_deleted", "datatype": dbt.type_timestamp()},
11+
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}
12+
] %}
13+
14+
{{ return(columns) }}
15+
16+
{% endmacro %}

0 commit comments

Comments
 (0)