-
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
Merged
fivetran-joemarkiewicz
merged 8 commits into
main
from
feature/netsuite2-fiscal-year-end
Apr 16, 2025
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b58c35f
feature/netsuite2-fiscal-year-end
fivetran-joemarkiewicz 3cbe8a7
variable updates
fivetran-joemarkiewicz 9ae1795
seed and test updates
fivetran-joemarkiewicz af076f1
docs updates
fivetran-joemarkiewicz e3ea3a2
pre-release versioning
fivetran-joemarkiewicz 5b84d9e
changelog adjustment
fivetran-joemarkiewicz 106fe8a
version bump and docs regen
fivetran-joemarkiewicz 405801d
release review updates
fivetran-joemarkiewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
integration_tests/seeds/netsuite2_accounting_period_fiscal_cal_data.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I would add something this is for Quickstart users.
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.
Updated.