fivetran / dbt_klaviyo

https://fivetran.github.io/dbt_klaviyo/
Apache License 2.0
5 stars 6 forks source link

BUG - Duplicate row detected during DML action #4

Closed bfockler closed 3 years ago

bfockler commented 3 years ago

Are you a current Fivetran customer? Yes

Describe the bug Using the default Fivetran <-> Klaviyo connector and this package is resulting in the following error message:

Database Error in model klaviyo__events (models/klaviyo__events.sql)
  100090 (42P18): Duplicate row detected during DML action

Expected behavior

Create model with no errors

Package Version

  - package: fivetran/klaviyo_source
    version: 0.1.1
  - package: fivetran/klaviyo
    version: 0.1.1

Warehouse

- [ ] BigQuery - [ ] Redshift - [x] Snowflake - [ ] Postgres - [ ] Databricks - [ ] Other (provide details below) **Additional context** This didn't happen on the first dbt run, only the scheduled ones after it. **Please indicate the level of urgency**

Just testing for the first time

Are you interested in contributing to this package?

fivetran-joemarkiewicz commented 3 years ago

Thanks @bfockler for opening this issue.

After some quick searching on dbt slack it seems that the error message you are receiving is due to an issue regarding the incremental unique key within klaviyo__events not being unique after subsequent incremental runs. This is why it most likely succeeded on your first run, but not on the following runs.

Our team will look into this issue and respond here when we have assigned and planned this bug fix effort.

fivetran-jamie commented 3 years ago

hey @bfockler could you try re-running after installing this branch? thinking this might do the trick

# packages.yml
  - git: https://github.com/fivetran/dbt_klaviyo.git
    revision: jr_working
bfockler commented 3 years ago

Thanks @fivetran-jamie, I ran it and did a subsequent run and didn't see the error so it looks good to me.

fivetran-jamie commented 3 years ago

woohoo! i'll push a new release (0.1.2) of the package with this fix. you can expect it to be on dbt hub in the next 1-2 days 🙂 also i'll leave the jr_working branch open if you'd like to use that in the meantime