fivetran/dbt_ad_reporting

BUG - Compilation Error "Carosel Media"

knlekash-rfa opened this issue · 3 comments

Are you a current Fivetran customer?

Yes, Red Fox Analytics

Describe the bug

I cloned this repo today. I ran dbt deps, I edited my project.yml to only include the connectors that are in my profile/database I hit "dbt run". I got the following error.

Compilation Error
  dbt found two resources with the name "int__facebook_ads__carousel_media_prep". Since these resources have the same name,
  dbt will be unable to find the correct resource when ref("int__facebook_ads__carousel_media_prep") is used. To fix this,
  change the name of one of these resources:
  - model.facebook_ads_creative_history.int__facebook_ads__carousel_media_prep (models\postgres\int__facebook_ads__carousel_media_prep.sql)
  - model.facebook_ads_creative_history.int__facebook_ads__carousel_media_prep (models\bigquery\int__facebook_ads__carousel_media_prep.sql)

Steps to reproduce

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

Expected behavior

Project variables configuration

name: 'ad_reporting'
profile: 'ad_reporting'
version: '0.5.1'
config-version: 2

require-dbt-version: [">=0.20.0"]

vars:
  ad_reporting__pinterest_enabled: false
  ad_reporting__microsoft_ads_enabled: true
  ad_reporting__linkedin_ads_enabled: false
  ad_reporting__google_ads_enabled: true
  ad_reporting__twitter_ads_enabled: false
  ad_reporting__facebook_ads_enabled: true
  ad_reporting__snapchat_ads_enabled: false

models:
  ad_reporting:
    +materialized: view
  
  pinterest:
    enabled: false
  pinterest_source:
    enabled: false
  
  microsoft_ads:
    enabled: true
  microsoft_ads_source:
    enabled: true
  
  linkedin:
    enabled: false
  linkedin_source:
    enabled: false
  
  twitter_ads:
    enabled: false
  twitter_ads_source:
    enabled: false
  
  facebook_ads:
    enabled: true
  facebook_ads_source:
    enabled: true
  facebook_ads_creative_history:
    enabled: true
  
  google_ads:
    enabled: true
  google_ads_source:
    enabled: true

  snapchat_ads:
    enabled: false
  snapchat_ads_source:
    enabled: false
|```

**Package Version**
<!---Copy and paste the contents of your `packages.yml` file below.-->
```yml
copy packages.yml here

Warehouse

  • BigQuery
  • Redshift
  • Snowflake
  • [X ] Postgres
  • Databricks
  • Other (provide details below)

Additional context

Screenshots

Please indicate the level of urgency

Are you interested in contributing to this package?

  • Yes, I can do this and open a PR for your review.
  • Possibly, but I'm not quite sure how to do this. I'd be happy to do a live coding session with someone to get this fixed.
  • No, I'd prefer if someone else fixed this. I don't have the time and/or don't know what the root cause of the problem is.

Hey @knlekash-rfa! Thanks for opening this issue!

I first noticed you mentioned that you cloned this repo. It would actually be best if you had your own dbt project that you then installed this project as a package within your packages.yml. This way you could leverage the contents of this package as a dependency and then have any custom models of yours as well!. Feel free to check out the Installation Instructions of the README for me details.

In regards to the error you are seeing, it is most likely occurring due to the Facebook models being enabled in your configuration. The models are all enabled by default, and sometime enabling the already enabled models can override our config and actually enable unnecessary ones as well (this is why you see the bigquery and postgres models being run in your dbt log. If you change your configuration to the below, then it should compile and run succesfully for you:

vars:
  ad_reporting__pinterest_enabled: false
  ad_reporting__microsoft_ads_enabled: true
  ad_reporting__linkedin_ads_enabled: false
  ad_reporting__google_ads_enabled: true
  ad_reporting__twitter_ads_enabled: false
  ad_reporting__facebook_ads_enabled: true
  ad_reporting__snapchat_ads_enabled: false

models:
  ad_reporting:
    +materialized: view
  
  pinterest:
    enabled: false
  pinterest_source:
    enabled: false
  
  linkedin:
    enabled: false
  linkedin_source:
    enabled: false
  
  twitter_ads:
    enabled: false
  twitter_ads_source:
    enabled: false

  snapchat_ads:
    enabled: false
  snapchat_ads_source:
    enabled: false

The only main update I applied was just removing the models: configurations that were set to true. This is because they are true by default.

Let me know if you have any other questions!

That's great to hear! I am always happy to help 😄

I'll close this issue since we solved the error you were seeing. Feel free to open another issue if you come across any other issues or have a question. Thanks!