Skip to content

Commit

Permalink
docs and such
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-jamie committed May 1, 2024
1 parent a1443dc commit d93c794
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# dbt_facebook_ads_source v0.7.3
[PR #34](https://github.com/fivetran/dbt_facebook_ads_source/pull/34) includes the following updates:
[PR #35](https://github.com/fivetran/dbt_facebook_ads_source/pull/35) includes the following updates:

## Bug Fixes
- Resolved the "duplicate column" error that would arise when the `facebook_ads__basic_ad_passthrough_metrics` variable included `reach` or `frequency`. `Reach` and `frequency` are included by default in the `stg_facebook_ads__basic_ad` model but will only persist to downstream transform models if specified in the `facebook_ads__basic_ad_passthrough_metrics` variable.
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions macros/get_basic_ad_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
{"name": "frequency", "datatype": dbt.type_float()}
] %}

{#
Reach and Frequency are not included in downstream models by default, though they are included in the staging model.
The below ensures that users can add Reach and Frequency to downstream models with the `facebook_ads__basic_ad_passthrough_metrics` variable
while avoiding duplicate column errors.
#}
{% set unique_passthrough = [] %}
{% for field in var('facebook_ads__basic_ad_passthrough_metrics') %}
{% if (field.alias if field.alias else field.name)|lower not in ('reach', 'frequency') %}
Expand Down
5 changes: 5 additions & 0 deletions models/stg_facebook_ads__basic_ad.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ final as (
coalesce(inline_link_clicks,0) as clicks,
spend

{#
Reach and Frequency are not included in downstream models by default, though they are included in the staging model.
The below ensures that users can add Reach and Frequency to downstream models with the `facebook_ads__basic_ad_passthrough_metrics` variable
while avoiding duplicate column errors.
#}
{%- set check = [] %}
{%- for field in var('facebook_ads__basic_ad_passthrough_metrics') -%}
{%- if (field.alias if field.alias else field.name)|lower == 'reach' %}
Expand Down

0 comments on commit d93c794

Please sign in to comment.