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] new_vs_repeat field in shopify__orders can be inconsistent on incremental runs #95

Open
1 of 4 tasks
fivetran-joemarkiewicz opened this issue Dec 23, 2024 · 0 comments
Assignees
Labels
error:unforced status:in_progress Currently being worked on type:bug Something is broken or incorrect

Comments

@fivetran-joemarkiewicz
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

I believe this logic in the shopify__orders model can produce inaccurate results based on the incremental logic within the model. I believe the window function to calculate the new_vs_repeat logic is only performed on the data within the window and not the entire table. As such, the logic could be incorrect if there a customer had a new order outside the window, but since it's not included in the incremental logic we won't be able to recognize that and the order which should actually be a repeat order is categorized as new.

Relevant error log or model output

Incorrect new_vs_repeat results

Expected behavior

The new_vs_repeat field is able to properly produce accurate results

Possible solution

We could remove the incremental strategy to address this. However, ideally we can resolve this without needing to remove the incremental strategy for Snowflake, Redshift, and Postgres. As of this moment, I don't have a solution in mind.

dbt Project configurations

Default

Package versions

Latest

What database are you using dbt with?

postgres, redshift, snowflake

How are you running this dbt package?

Fivetran Quickstart Data Model

dbt Version

Latest

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance.
  • No.
@fivetran-joemarkiewicz fivetran-joemarkiewicz added the type:bug Something is broken or incorrect label Dec 23, 2024
@fivetran-avinash fivetran-avinash self-assigned this Jan 13, 2025
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
Projects
None yet
Development

No branches or pull requests

2 participants