Skip to content
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

Release/v0.16.0 #149

Merged
merged 12 commits into from
Dec 2, 2024
Merged

Release/v0.16.0 #149

merged 12 commits into from
Dec 2, 2024

Conversation

fivetran-catfritz
Copy link
Contributor

@fivetran-catfritz fivetran-catfritz commented Nov 22, 2024

PR Overview

This PR will address the following Issue/Feature:

This PR will result in the following new package version:

  • v0.16.0 breaking due to fundamental changes with the incremental logic for the end models.

Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:

Breaking

Changes (Full Refresh Required)

  • Revised the incremental logic of the netsuite2__transaction_details model to use transaction_lines CTE as the primary driver instead of transactions.
    • This ensures all transaction lines are captured, including those synced after the parent transaction.
    • This also aligns with transaction_lines serving as the base CTE in the model, onto which all other CTEs are left-joined.
    • When the balance_sheet_transaction_detail_columns and income_statement_transaction_detail_columns variables are used in the netsuite2__balance_sheet and netsuite2__income_statement models, all transactions are now included during incremental runs. This ensures no transactions are missed, aligning with the changes made in the netsuite2__transaction_details model.
    • We still recommend running dbt --full-refresh periodically to maintain data quality of the models.

Documentation

  • Updated dbt documentation definitions.

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

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:

  • See internal ticket for data results
  • Consistency and integrity tests pass
    • Screenshot 2024-11-25 at 6 51 28 PM

If you had to summarize this PR in an emoji, which would it be?

💃

@fivetran-catfritz fivetran-catfritz self-assigned this Nov 22, 2024

{% if is_incremental() %}
where _fivetran_synced_date >= {{ max_fivetran_synced_date }}
{% endif %}
),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed since upstream relies on transaction_lines now instead of transactions for incremental, and we don't want to miss any transactions. also this section is only used if balance sheet transaction detail columns are specified dbt_project.yml file.

Comment on lines -32 to -35

{% if is_incremental() %}
where _fivetran_synced_date >= {{ max_fivetran_synced_date }}
{% endif %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed same as balance_sheet

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall these changes look good to me! Thanks for adding a new validation test to ensure integrity of the incremental model going forward. I just have a three small comments but nothing worth blocking an approval. Thanks!

For Netsuite2, [PR #149](https://github.com/fivetran/dbt_netsuite/pull/149) includes the following updates:

## Breaking Changes (Full Refresh Required)
- Revised the incremental logic of the `netsuite2__transaction_details` model to use `transaction_lines` CTE as the primary driver instead of `transactions`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add a small note here to mention that we still encourage periodic full refresh runs to ensure data quality over time. Similar to what we say in the README.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

with transactions_with_converted_amounts as (
select *
from {{ref('int_netsuite2__tran_with_converted_amounts')}}

{% if is_incremental() %}
where _fivetran_synced_date >= {{ max_fivetran_synced_date }}
where _fivetran_synced_date >= {{ netsuite.netsuite_lookback(from_date='max(_fivetran_synced_date)', datepart='day', interval=var('lookback_window', 3)) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question - is there an added benefit to having this exist directly here as opposed to in the set statement we had previously? Or is this mainly to make the code dryer and more concise?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had used a variable before because I used the result in two places, but since I removed the the 2nd is_incremental block, I just moved it back down here so it was inline.

Comment on lines +6 to +8
{# This test is to check if the transaction_details has the same number of transactions
as the source transaction lines table after joining with the transactions source.
This is important when making incremental logic changes. #}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great test to have especially for incremental integrity. Thanks for adding this!

Copy link
Contributor Author

@fivetran-catfritz fivetran-catfritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-joemarkiewicz Thanks--made the updates!

For Netsuite2, [PR #149](https://github.com/fivetran/dbt_netsuite/pull/149) includes the following updates:

## Breaking Changes (Full Refresh Required)
- Revised the incremental logic of the `netsuite2__transaction_details` model to use `transaction_lines` CTE as the primary driver instead of `transactions`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

with transactions_with_converted_amounts as (
select *
from {{ref('int_netsuite2__tran_with_converted_amounts')}}

{% if is_incremental() %}
where _fivetran_synced_date >= {{ max_fivetran_synced_date }}
where _fivetran_synced_date >= {{ netsuite.netsuite_lookback(from_date='max(_fivetran_synced_date)', datepart='day', interval=var('lookback_window', 3)) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had used a variable before because I used the result in two places, but since I removed the the 2nd is_incremental block, I just moved it back down here so it was inline.

@fivetran-reneeli
Copy link
Contributor

Would we need to add an account join here as well?

@fivetran-reneeli fivetran-reneeli self-requested a review November 27, 2024 18:35
@fivetran-catfritz
Copy link
Contributor Author

Would we need to add an account join here as well?

@fivetran-joemarkiewicz Could you take a look at this? @fivetran-reneeli asked a good question, but wondering if there was a reason.

@fivetran-catfritz
Copy link
Contributor Author

@fivetran-joemarkiewicz I removed the account_id updates, could you take a look again?>

Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for making this update. @fivetran-catfritz as a final request please unlink Issue #128 from this PR so we don't auto close it after merging into main.

@fivetran-catfritz fivetran-catfritz merged commit 379cb28 into main Dec 2, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants