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] Can't Pull Through Reach #34

Closed
2 of 4 tasks
alexmacartney opened this issue Apr 26, 2024 · 5 comments
Closed
2 of 4 tasks

[Bug] Can't Pull Through Reach #34

alexmacartney opened this issue Apr 26, 2024 · 5 comments
Assignees
Labels
error:forced priority:p4 Affects few users; pick up when available status:accepted Scoped and accepted into queue type:bug Something is broken or incorrect update_type:models Primary focus requires model updates

Comments

@alexmacartney
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

reach is already being pulled through manually in stg_facebook_ads__basic_ad.sql so when I try to pass through reach using the below I get a duplicate field and the model can't run. I need to pass through the field for subsequent models using the dbt_facebook_ads repo. I believe the same would be true for frequency.

facebook_ads__basic_ad_passthrough_metrics: 
  - name: "reach"

Relevant error log or model output

with base as (
    select * 
    from `analytics-dev-406710`.`alex_analytics_dev_package_fivetran_ads_source`.`stg_facebook_ads__basic_ad_tmp`
),
fields as (
    select
        
    
    
    ad_id
    
 as 
    
    ad_id
    
, 
    
    
    ad_name
    
 as 
    
    ad_name
    
, 
    
    
    adset_name
    
 as 
    
    adset_name
    
, 
    
    
    date
    
 as 
    
    date
    
, 
    
    
    account_id
    
 as 
    
    account_id
    
, 
    
    
    impressions
    
 as 
    
    impressions
    
, 
    
    
    inline_link_clicks
    
 as 
    
    inline_link_clicks
    
, 
    
    
    spend
    
 as 
    
    spend
    
, 
    
    
    reach
    
 as 
    
    reach
    
, 
    
    
    frequency
    
 as 
    
    frequency
    
, 
    
    
    reach
    
 as 
    
    reach
    
        
    
        
, cast('' as STRING) as source_relation
    from base
),
final as (
    select
        source_relation, 
        cast(ad_id as bigint) as ad_id,
        ad_name,
        adset_name as ad_set_name,
        date as date_day,
        cast(account_id as bigint) as account_id,
        impressions,
        coalesce(inline_link_clicks,0) as clicks,
        spend,
        reach,
        frequency
        
    
        
            
                , reach
            
        
    
    from fields
)
select * 
from final

Expected behavior

I would expect reach to not be in the initial list of variables so that when the macro adds it there are no duplicate fields. This would then allow the model to run.

dbt Project configurations

facebook_ads__basic_ad_passthrough_metrics: 
  - name: "reach"

Package versions

packages:

  - package: dbt-labs/dbt_utils
    version: [">=1.0.0", "<2.0.0"]
  
  - package: Velir/ga4
    version: 5.1.0

  - package: fivetran/google_ads
    version: [">=0.10.0", "<0.11.0"]
  
  - package: fivetran/facebook_ads
    version: [">=0.7.0", "<0.8.0"]

  - package: fivetran/instagram_business
    version: [">=0.2.0", "<0.3.0"]

What database are you using dbt with?

bigquery

dbt Version

Core:

  • installed: 1.6.6
  • latest: 1.7.13 - Update available!

Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:

  • bigquery: 1.6.7 - Update available!

At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Additional Context

No response

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

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.
@alexmacartney
Copy link
Author

Sorry if I have done anything wrong. This is my first time reporting an issue on GitHub!

@fivetran-catfritz
Copy link
Contributor

Hi @alexmacartney thank you for opening this issue--the info you provided is perfect! We agree that the issue with the reach and frequency metrics needs to be addressed. The next step is for us internally to find the best way to deprecate those columns in stg_facebook_ads__basic_ad while maintaining backwards compatibility for all users. We'll keep you posted.

@alexmacartney
Copy link
Author

@fivetran-catfritz Great! Please let me know if there is anything I can do to help.

@fivetran-catfritz
Copy link
Contributor

Hi @alexmacartney thanks for the ping. There is nothing you need to do for now! We are accepting this issue and plan to release an update in the coming weeks. We might reach out to you to test our proposed changes in the next week or so as well.

@fivetran-catfritz fivetran-catfritz added type:bug Something is broken or incorrect priority:p4 Affects few users; pick up when available status:accepted Scoped and accepted into queue update_type:models Primary focus requires model updates error:forced labels May 1, 2024
@fivetran-jamie fivetran-jamie self-assigned this May 1, 2024
@fivetran-jamie
Copy link
Contributor

hey @alexmacartney - the fix for this is live and will be automatically installed with facebook_ads [">=0.7.0", "<0.8.0"]; you should be able to pass reach and frequency to the facebook_ads__basic_ad_passthrough_metrics var

going to close this issue but please reopen if the fix isn't working for you 🤠

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error:forced priority:p4 Affects few users; pick up when available status:accepted Scoped and accepted into queue type:bug Something is broken or incorrect update_type:models Primary focus requires model updates
Projects
None yet
Development

No branches or pull requests

3 participants