-
Notifications
You must be signed in to change notification settings - Fork 35
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
bug/account-type-id #84
Conversation
models/netsuite2/intermediate/int_netsuite2__tran_with_converted_amounts.sql
Show resolved
Hide resolved
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.
@fivetran-catfritz these changes look great. This is a HUGE enhancement to the package by making it more accurate and robust to handle changing Netsuite2 environments. Thanks for the due diligence in updating these models and also documenting your validation efforts. I was also able to confirm that for every period and for every account in our internal data that the totals match between the current version of the package and your changes for IS and BS.
I do have just a few minor and final requests and suggestions. Would you be able to address these. Then this should be good to go for approval!
CHANGELOG.md
Outdated
- netsuite2__balance_sheet | ||
- netsuite2__income_statement | ||
- netsuite2__transaction_details | ||
- This change was implemented because `type_name` was previously utilized to categorize records, which was causing issues for users that customized the `type_name` values. Utilizing the unique identifier `account_type_id` instead produces more accurate results in the final models. |
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.
Can we just clarify here that we are referencing the above bullet and that this is only for Netsuite2
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 recall Jamie found a Netsuite doc that showed this mapping. Would we be able to share that in the CHANGELOG so customers are aware of how we were informed around the proper pairings for these changes?
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.
Found the source Jamie identified
https://blog.prolecto.com/2013/09/10/netsuite-searchfilter-internal-account-type-codes/
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.
Done!
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.
Thanks! Can you also include the link somewhere just for reference so customers know where we found the mapping.
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.
added
models/netsuite2/intermediate/int_netsuite2__tran_with_converted_amounts.sql
Show resolved
Hide resolved
lower(accounts.type_name) like 'accounts payable%' as is_accounts_payable, | ||
lower(accounts.type_name) like 'accounts receivable%' as is_accounts_receivable, | ||
lower(accounts.account_type_id) = 'acctpay' as is_accounts_payable, | ||
lower(accounts.account_type_id) = 'acctrec' as is_accounts_receivable, | ||
lower(accounts.name) like '%intercompany%' as is_account_intercompany, |
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.
It looks like we didn't update this account name. I agree with you that it seems this is the correct move as there is not a lookup key for these fields. But would you be able to just add some clarification in this thread for posterity.
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.
This is a good point. I hadn't really considered it, but I looked into it, and there is a flag in a column called eliminate
in the accounts source table that is meant to flag an account as intercompany. See the netsuite docs for field eliminate
. See also this doc (and search for "eliminate").
I added this to the source and tried this out, however unlike my other changes, this does produce different results from our current model. For example our data has some accounts marked as eliminate = T
, but the account name does not contain intercompany
. Thinking this needs to be a new issue for further investigation?
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.
Thanks for investigating! This is interesting, however I would prefer we do not make the update here as you can see internally that the changes without the eliminate update tie out, but with the eliminate update they do not. I don't feel there is a need for a new issue as there currently is not an existing issue around this.
Let's discuss at standup what our internally procedures may to flag something like this. I don't feel it is necessary to be an issue, but we also don't have enough information to create a FR.
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.
From discussion, we will leave this flag as-is for now, but will come back to it.
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.
@fivetran-catfritz these changes look good! I just have two very minor updates to request before we kick off this for release review.
CHANGELOG.md
Outdated
- netsuite2__balance_sheet | ||
- netsuite2__income_statement | ||
- netsuite2__transaction_details | ||
- The above change was implemented for Netsuite2 because `type_name` was previously utilized to categorize records, which was causing issues for users that customized the `type_name` values. Utilizing the unique identifier `account_type_id` instead produces more accurate results in the final models. Below is a list of the account type name and type id pairings used: |
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.
Can you add the link here for where the pairings came from.
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.
added
lower(accounts.name) like '%intercompany%' as is_account_intercompany, | ||
coalesce(parent_account.name, accounts.name) as parent_account_name, | ||
lower(accounts.type_name) like '%expense' as is_expense_account, -- includes deferred expense | ||
lower(accounts.type_name) like '%income' as is_income_account, | ||
lower(accounts.account_type_id) in ('expense', 'othexpense', 'deferexpense') as is_expense_account, -- includes deferred expense |
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.
We can probably remove the comment here as it is a bit obvious with these updates.
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.
done
PR Overview
This PR will address the following Issue/Feature:
This PR will result in the following new package version:
Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:
account_type_id
instead oftype_name
:type_name
was previously utilized to categorize records, which was causing issues for users that customized thetype_name
values. Utilizing the unique identifieraccount_type_id
instead produces more accurate results in the final models.accepted_values
test from columnaccount_type_names
in modelnetsuite2__transaction_details
since logic is now based onaccount_type_id
instead, and type names can be changed by the user.account_type_id
** ❗ Note - references to "prepaid" were removed since they became moot when moving to using ids.
PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
dbt run –vars (if applicable)Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
Standard Updates
Please acknowledge that your PR contains the following standard updates:
DECISIONLOG updates have been updated (if applicable)dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
If you had to summarize this PR in an emoji, which would it be?
🆔