Skip to content

Commit

Permalink
joe feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-jamie committed Nov 6, 2024
1 parent 3ede410 commit 78e3f65
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 6 deletions.
1 change: 0 additions & 1 deletion docs/run_results.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ with prod as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_prod.facebook_ads__account_report
group by 1
),
Expand All @@ -19,6 +21,8 @@ dev as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_dev.facebook_ads__account_report
group by 1
),
Expand All @@ -32,6 +36,10 @@ final as (
dev.impressions as dev_impressions,
prod.spend as prod_spend,
dev.spend as dev_spend
{# prod.conversions_value as prod_conversions_value,
dev.conversions_value as dev_conversions_value,
prod.conversions as prod_conversions,
dev.conversions as dev_conversions, #}
from prod
full outer join dev
on dev.account_id = prod.account_id
Expand All @@ -42,4 +50,6 @@ from final
where
abs(prod_clicks - dev_clicks) >= .01
or abs(prod_impressions - dev_impressions) >= .01
or abs(prod_spend - dev_spend) >= .01
or abs(prod_spend - dev_spend) >= .01
{# or abs(prod_conversions_value - dev_conversions_value) >= .01
or abs(prod_conversions - dev_conversions) >= .01 #}
12 changes: 11 additions & 1 deletion integration_tests/tests/consistency/consistency_ad_report.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ with prod as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_prod.facebook_ads__ad_report
group by 1
),
Expand All @@ -19,6 +21,8 @@ dev as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_dev.facebook_ads__ad_report
group by 1
),
Expand All @@ -32,6 +36,10 @@ final as (
dev.impressions as dev_impressions,
prod.spend as prod_spend,
dev.spend as dev_spend
{# prod.conversions_value as prod_conversions_value,
dev.conversions_value as dev_conversions_value,
prod.conversions as prod_conversions,
dev.conversions as dev_conversions, #}
from prod
full outer join dev
on dev.ad_id = prod.ad_id
Expand All @@ -42,4 +50,6 @@ from final
where
abs(prod_clicks - dev_clicks) >= .01
or abs(prod_impressions - dev_impressions) >= .01
or abs(prod_spend - dev_spend) >= .01
or abs(prod_spend - dev_spend) >= .01
{# or abs(prod_conversions_value - dev_conversions_value) >= .01
or abs(prod_conversions - dev_conversions) >= .01 #}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ with prod as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_prod.facebook_ads__ad_set_report
group by 1
),
Expand All @@ -19,6 +21,8 @@ dev as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_dev.facebook_ads__ad_set_report
group by 1
),
Expand All @@ -32,6 +36,10 @@ final as (
dev.impressions as dev_impressions,
prod.spend as prod_spend,
dev.spend as dev_spend
{# prod.conversions_value as prod_conversions_value,
dev.conversions_value as dev_conversions_value,
prod.conversions as prod_conversions,
dev.conversions as dev_conversions, #}
from prod
full outer join dev
on dev.ad_set_id = prod.ad_set_id
Expand All @@ -42,4 +50,6 @@ from final
where
abs(prod_clicks - dev_clicks) >= .01
or abs(prod_impressions - dev_impressions) >= .01
or abs(prod_spend - dev_spend) >= .01
or abs(prod_spend - dev_spend) >= .01
{# or abs(prod_conversions_value - dev_conversions_value) >= .01
or abs(prod_conversions - dev_conversions) >= .01 #}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ with prod as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_prod.facebook_ads__campaign_report
group by 1
),
Expand All @@ -19,6 +21,8 @@ dev as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_dev.facebook_ads__campaign_report
group by 1
),
Expand All @@ -32,6 +36,10 @@ final as (
dev.impressions as dev_impressions,
prod.spend as prod_spend,
dev.spend as dev_spend
{# prod.conversions_value as prod_conversions_value,
dev.conversions_value as dev_conversions_value,
prod.conversions as prod_conversions,
dev.conversions as dev_conversions, #}
from prod
full outer join dev
on dev.campaign_id = prod.campaign_id
Expand All @@ -42,4 +50,6 @@ from final
where
abs(prod_clicks - dev_clicks) >= .01
or abs(prod_impressions - dev_impressions) >= .01
or abs(prod_spend - dev_spend) >= .01
or abs(prod_spend - dev_spend) >= .01
{# or abs(prod_conversions_value - dev_conversions_value) >= .01
or abs(prod_conversions - dev_conversions) >= .01 #}
12 changes: 11 additions & 1 deletion integration_tests/tests/consistency/consistency_url_report.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ with prod as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_prod.facebook_ads__url_report
group by 1
),
Expand All @@ -19,6 +21,8 @@ dev as (
sum(coalesce(clicks, 0)) as clicks,
sum(coalesce(impressions, 0)) as impressions,
sum(coalesce(spend, 0)) as spend
{# sum(coalesce(conversions_value, 0)) as conversions_value,
sum(coalesce(conversions, 0)) as conversions #}
from {{ target.schema }}_facebook_ads_dev.facebook_ads__url_report
group by 1
),
Expand All @@ -32,6 +36,10 @@ final as (
dev.impressions as dev_impressions,
prod.spend as prod_spend,
dev.spend as dev_spend
{# prod.conversions_value as prod_conversions_value,
dev.conversions_value as dev_conversions_value,
prod.conversions as prod_conversions,
dev.conversions as dev_conversions, #}
from prod
full outer join dev
on dev.ad_id = prod.ad_id
Expand All @@ -42,4 +50,6 @@ from final
where
abs(prod_clicks - dev_clicks) >= .01
or abs(prod_impressions - dev_impressions) >= .01
or abs(prod_spend - dev_spend) >= .01
or abs(prod_spend - dev_spend) >= .01
{# or abs(prod_conversions_value - dev_conversions_value) >= .01
or abs(prod_conversions - dev_conversions) >= .01 #}

0 comments on commit 78e3f65

Please sign in to comment.