-
Notifications
You must be signed in to change notification settings - Fork 20
Feature/netsuite2 fiscal year end #61
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
Changes from 7 commits
b58c35f
3cbe8a7
9ae1795
af076f1
e3ea3a2
5b84d9e
106fe8a
405801d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,19 @@ | ||||||
# dbt_netsuite_source version.version | ||||||
# dbt_netsuite_source v0.12.0 | ||||||
|
||||||
## Breaking Schema Changes | ||||||
- 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: | ||||||
- Quickstart users: enable the fiscalcalendar table in the connection schema tab. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed in the Fivetran schema tab this table is capitalized as FiscalCalendar. Should we update with this casing syntax or do we think this is ok? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be fine since this is how the table will look in the destination. As long as the casing is the same in the downstream quickstart.yml that's what really matters. |
||||||
- 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). | ||||||
|
||||||
## Documentation | ||||||
- Corrected references to connectors and connections in the README. ([#60](https://github.com/fivetran/dbt_netsuite_source/pull/60)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||||||
|
||||||
# dbt_netsuite_source v0.12.0-a1 | ||||||
|
||||||
## Breaking Schema Changes | ||||||
- 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: | ||||||
- Quickstart users: enable the fiscalcalendar table in the connection schema tab. | ||||||
- 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). | ||||||
|
||||||
## Documentation | ||||||
- Corrected references to connectors and connections in the README. ([#60](https://github.com/fivetran/dbt_netsuite_source/pull/60)) | ||||||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
_fivetran_id,_fivetran_deleted,_fivetran_synced,accountingperiod,date_deleted,fiscalcalendar,parent | ||
t6+LTClexXfChh/pMhoj1F9SpSs=,FALSE,2022-07-10 22:17:10,245,,1,244 | ||
hbwug8y6jPTTembEaYVZlsljZuQ=,FALSE,2022-07-10 22:17:10,252,,1,239 | ||
hxkIkIIeDjsG8OgPAlvQVe9a6TE=,FALSE,2022-07-10 22:17:10,275,,1,274 | ||
H00Ert0t6kQHovZX4pHHC4N4d0Y=,FALSE,2022-07-10 22:17:10,6,,1,1 | ||
KI+pra1uPLFPsBHFuvT/tXCaWdg=,FALSE,2022-07-10 22:17:10,184,,1,171 | ||
JIpeyH5xsYzCF0YbPKr7obXrkhA=,FALSE,2022-07-10 22:17:10,218,,1,205 | ||
hxkIkIIeDjsG8OgPAlvQVe9a6TE=,FALSE,2022-07-10 22:17:10,275,,2,274 | ||
H00Ert0t6kQHovZX4pHHC4N4d0Y=,FALSE,2022-07-10 22:17:10,6,,2,1 | ||
KI+pra1uPLFPsBHFuvT/tXCaWdg=,FALSE,2022-07-10 22:17:10,20,,3,171 | ||
JIpeyH5xsYzCF0YbPKr7obXrkhA=,FALSE,2022-07-10 22:17:10,21,,3,205 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id,externalid,fiscalmonth,isdefault,name,_fivetran_deleted,date_deleted,_fivetran_synced | ||
1,,JAN,true,Calendar Year,false,,2022-05-27 13:00:58 | ||
2,,APR,false,April Fiscal Year,false,,2022-05-27 13:00:58 | ||
3,,CAL,false,Incorrectly Formed Month Abbreviation,false,,2022-05-27 13:00:58 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% macro get_fiscalcalendar_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "id", "datatype": dbt.type_int()}, | ||
{"name": "externalid", "datatype": dbt.type_string()}, | ||
{"name": "fiscalmonth", "datatype": dbt.type_string()}, | ||
{"name": "isdefault", "datatype": dbt.type_string()}, | ||
{"name": "name", "datatype": dbt.type_string()}, | ||
{"name": "_fivetran_deleted", "datatype": "boolean"}, | ||
{"name": "date_deleted", "datatype": dbt.type_timestamp()}, | ||
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__fiscal_calendar_enabled', false)) }} | ||
|
||
with base as ( | ||
|
||
select * | ||
from {{ ref('stg_netsuite2__fiscal_calendar_tmp') }} | ||
), | ||
|
||
fields as ( | ||
|
||
select | ||
{{ | ||
fivetran_utils.fill_staging_columns( | ||
source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__fiscal_calendar_tmp')), | ||
staging_columns=get_fiscalcalendar_columns() | ||
) | ||
}} | ||
from base | ||
), | ||
|
||
final as ( | ||
|
||
select | ||
id as fiscal_calendar_id, | ||
externalid as external_id, | ||
fiscalmonth as fiscal_month, | ||
isdefault as is_default, | ||
name, | ||
date_deleted, | ||
_fivetran_deleted, | ||
_fivetran_synced | ||
from fields | ||
where not coalesce(_fivetran_deleted, false) | ||
) | ||
|
||
select * | ||
from final |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__fiscal_calendar_enabled', false)) }} | ||
|
||
select * | ||
from {{ var('netsuite2_fiscal_calendar') }} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -81,6 +81,29 @@ models: | |||||
- name: parent_id | ||||||
description: Reference to the parent fiscal calendar accounting period. | ||||||
|
||||||
- name: stg_netsuite2__fiscal_calendar | ||||||
description: Table containing a list of fiscal calendars, their names, and starting fiscal months. Used to determine fiscal year boundaries. | ||||||
columns: | ||||||
- name: fiscal_calendar_id | ||||||
description: Internal identifier for the fiscal calendar record. | ||||||
tests: | ||||||
- unique | ||||||
- not_null | ||||||
- name: external_id | ||||||
description: Custom or system-defined external identifier for the fiscal calendar. | ||||||
- name: fiscal_month | ||||||
description: The starting month of the fiscal calendar (e.g., JAN for January, APR for April). | ||||||
- name: is_default | ||||||
description: "Boolean flag indicating whether this is the default fiscal calendar. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. Thanks for catching! |
||||||
- name: name | ||||||
description: Name of the fiscal calendar (e.g., 'Standard Fiscal Year')." | ||||||
- name: _fivetran_deleted | ||||||
description: "{{ doc('_fivetran_deleted') }}" | ||||||
- name: date_deleted | ||||||
description: Timestamp when the record was deleted in the source system, if applicable. | ||||||
- name: _fivetran_synced | ||||||
description: "{{ doc('_fivetran_synced') }}" | ||||||
|
||||||
- name: stg_netsuite2__accounting_periods | ||||||
description: "{{ doc('account_periods_table') }}" | ||||||
columns: | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"PR" added, but I prefer the structure where each individual update is detailing a change and how to take advantage of it. Keeping the "To enable this feature:" within the same primary bullet as before and letting the sub-bullets be the enable steps.