fivetran / dbt_microsoft_ads_source

Fivetran data models for Microsoft (Bing) Ads built using dbt.
https://fivetran.github.io/dbt_microsoft_ads_source/
Apache License 2.0
4 stars 7 forks source link

BUG - stg_ad_history failing uniqueness tests #13

Closed fivetran-jamie closed 2 years ago

fivetran-jamie commented 2 years ago

Are you a current Fivetran customer?

fivetran made issue (but this from veronica beard)

Describe the bug

Uniqueness test is failing on the staging ad_history table. in the customer's raw table ad_history table, ad id|| modified_time are indeed unique, so I am thinking that the joins with ad_group and/or campaign are causing fanout

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

the test should pass!

Project variables configuration

copy dbt_project.yml here

Package Version

copy packages.yml here

Warehouse

- [x] BigQuery - [ ] Redshift - [ ] Snowflake - [ ] Postgres - [ ] Databricks - [ ] Other (provide details below) **Additional context** **Screenshots**

Please indicate the level of urgency

Are you interested in contributing to this package?

MaximeLagresle commented 2 years ago

Hi,

Sharing our dbt_project.yml configs for that specific package:


vars:

    microsoft_ads_schema: bingads
    microsoft_ads_database: fivetran-data-culture-big-vv9p

    microsoft_ads_source:
      microsoft_auto_tagging_enabled: true  

models:

  microsoft_ads_source:
    +schema: staging
    +materialized: view

  microsoft_ads:
    +schema: marketing  # leave blank for just the target_schema
fivetran-jamie commented 2 years ago

thanks @MaximeLagresle ! so i think i may have found the culprit here. could you try out my working branch and see if the uniqueness test is still failing?

# packages.yml
packages:
  - git: https://github.com/fivetran/dbt_microsoft_ads_source.git
    revision: bug/ad-history-uniqueness
MaximeLagresle commented 2 years ago

Hey Jamie,

Thanks so much for quickly looking into that!

Unfortunately, I still have the error…

Here’s what I did:

Let me know if I should do anything else!

fivetran-jamie commented 2 years ago

ah i think you need to dbt run in between the dbt deps and dbt test -- could you try that?

MaximeLagresle commented 2 years ago

@fivetran-jamie my bad, you're right it works now!

fivetran-jamie commented 2 years ago

great! this is merged and released

MaximeLagresle commented 2 years ago

great! thanks @fivetran-jamie !