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

[Bug] Division by zero errors originating from intermediate deposit models #137

Closed
2 of 4 tasks
fivetran-avinash opened this issue Aug 8, 2024 · 2 comments
Closed
2 of 4 tasks
Assignees
Labels
error:unforced status:in_progress Currently being worked on type:bug Something is broken or incorrect update_type:models Primary focus requires model updates

Comments

@fivetran-avinash
Copy link
Contributor

fivetran-avinash commented Aug 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Quickstart customers were experiencing division by zero errors after upgrading to the recent release of the package. This is because in the v0.14.0 release we introduced changes to our intermediate deposit models to support multicurrency that required a division operation on total_amount from the deposits source. But we didn't account for the possibility that the denominators can be zero. We will introduce functionality that sets these values to null.

Relevant error log or model output

"Database error in model `int_quickbooks__deposit_double_entry`... division by zero"

"Database error in model `quickbooks__expenses_sales_enhanced`... division by zero"

Expected behavior

Successful compilation when the total_amount for a deposit is zero.

dbt Project configurations

models:
  quickbooks:
    +materialized: table
    +schema: quickbooks
    double_entry_transactions:
      +schema: quickbooks_intermediate
      +materialized: table
    transaction_lines:
      +materialized: ephemeral ##this will generate the error in the end model--materializing it in the table will fix the issue.
    intermediate:
      +materialized: ephemeral

Package versions

packages:

  • package: fivetran/quickbooks_source
    version: [">=0.10.0", "<0.11.0"]

What database are you using dbt with?

snowflake, bigquery

dbt Version

1.7.16

Additional Context

See Height ticket T-759329

Are you willing to open a PR to help address this issue?

  • Yes.
  • Yes, but I will probably need assistance.
  • No.
@fivetran-avinash fivetran-avinash added type:bug Something is broken or incorrect status:in_progress Currently being worked on update_type:models Primary focus requires model updates error:unforced labels Aug 8, 2024
@fivetran-avinash fivetran-avinash self-assigned this Aug 8, 2024
@fivetran-avinash fivetran-avinash changed the title [Bug] Division by zero errors on intermediate deposit models [Bug] Division by zero errors originating from intermediate deposit models Aug 8, 2024
@fivetran-joemarkiewicz
Copy link
Contributor

@fivetran-avinash is this issue good to be closed out?

@fivetran-avinash
Copy link
Contributor Author

@fivetran-joemarkiewicz yes, thanks for catching!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error:unforced status:in_progress Currently being worked on type:bug Something is broken or incorrect update_type:models Primary focus requires model updates
Projects
None yet
Development

No branches or pull requests

2 participants