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

Fix divide by zero error #138

Merged
merged 4 commits into from
Aug 12, 2024
Merged

Conversation

fivetran-avinash
Copy link
Contributor

@fivetran-avinash fivetran-avinash commented Aug 8, 2024

PR Overview

This PR will address the following Issue/Feature: [#137]

This PR will result in the following new package version: 0.14.1

No fields are changed, just the logic of how some fields are calculated.

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

Bug Fixes

  • Added nullif logic to account for "divide by zero" errors in int_quickbooks__deposit_double_entry and int_quickbooks__deposit_transactions for when total_amount values from the deposit source table
    are zero.

Under the Hood

  • Added integrity test within integration tests to compare deposit amounts between int_quickbooks__deposit_double_entry and deposit transaction_type values in quickbooks__general_ledger.
  • Modified seed files in integration_tests to reproduce issue and confirm fixes.

PR Checklist

Basic Validation

Please acknowledge that you have successfully performed the following commands locally:

  • dbt run –full-refresh && dbt test
  • [NA] 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:

After modifying the seed files, we were able to reproduce the error. customers were experiencing.
Screenshot 2024-08-08 at 1 47 43 PM

Adding the nullif logic resolved the errors.

We also constructed an additional integrity test deposit_ledger_amounts_match to ensure that there are no discrepancies on amounts from the new logic.

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

0️⃣

CHANGELOG.md Outdated
are zero.

## Under the Hood
- Added integrity test within integration tests to compare deposit amounts between `int_quickbooks__deposit_double_entry` and deposit `transaction_type` values in `quickbooks__general_ledger`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also just drop the name of the actual integrity test to make it more straightforward

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed!

Copy link
Contributor

@fivetran-reneeli fivetran-reneeli left a comment

Choose a reason for hiding this comment

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

Looks good! Approved with just 1 small working comment in the Changelog.

@fivetran-avinash fivetran-avinash merged commit d09c843 into main Aug 12, 2024
8 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
Development

Successfully merging this pull request may close these issues.

2 participants