Skip to content

Commit 6aa47a0

Browse files
Merge pull request #26 from fivetran/feature/fb-account-fields
Feature - add fb account fields
2 parents 270efac + 33ab7b2 commit 6aa47a0

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

dbt_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'ad_reporting'
2-
version: '0.4.0'
2+
version: '0.4.1'
33
config-version: 2
44

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

integration_tests/dbt_project.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'ad_reporting_integration_tests'
2-
version: '0.4.0'
2+
version: '0.4.1'
33
profile: 'integration_tests'
44
config-version: 2
55

@@ -95,10 +95,12 @@ seeds:
9595
+column_types:
9696
created_time: timestamp
9797
last_modified_time: timestamp
98+
account_id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"
9899
linkedin_campaign_history_data:
99100
+column_types:
100101
created_time: timestamp
101102
last_modified_time: timestamp
103+
account_id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"
102104

103105
### Twitter Seeds
104106

@@ -165,6 +167,7 @@ seeds:
165167
facebook_ads_account_history_data:
166168
+column_types:
167169
id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"
170+
name: "{{ 'string' if target.name in ['bigquery','spark'] else 'varchar' }}"
168171
facebook_ads_ad_history_data:
169172
+column_types:
170173
id: "{{ 'int64' if target.name == 'bigquery' else 'bigint' }}"

models/stg_facebook_ads.sql

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ with base as (
99

1010
select
1111
cast(date_day as date) as date_day,
12+
account_name,
13+
cast(account_id as {{ dbt_utils.type_string() }}) as account_id,
1214
base_url,
1315
url_host,
1416
url_path,
@@ -26,7 +28,7 @@ with base as (
2628
sum(coalesce(impressions, 0)) as impressions,
2729
sum(coalesce(spend, 0)) as spend
2830
from base
29-
{{ dbt_utils.group_by(14) }}
31+
{{ dbt_utils.group_by(16) }}
3032

3133

3234
)

models/stg_google_ads.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ with base as (
1111
'Google Ads' as platform,
1212
cast(date_day as date) as date_day,
1313
account_name,
14-
external_customer_id as account_id,
14+
cast(external_customer_id as {{ dbt_utils.type_string() }}) as account_id,
1515
campaign_name,
1616
cast(campaign_id as {{ dbt_utils.type_string() }}) as campaign_id,
1717
ad_group_name,

models/stg_linkedin_ads.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ with base as (
1111
'LinkedIn Ads' as platform,
1212
cast(date_day as date) as date_day,
1313
account_name,
14-
account_id,
14+
cast(account_id as {{ dbt_utils.type_string() }}) as account_id,
1515
campaign_group_name as campaign_name,
1616
cast(campaign_group_id as {{ dbt_utils.type_string() }}) as campaign_id,
1717
campaign_name as ad_group_name,

models/stg_microsoft_ads.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ with base as (
1111
'Microsoft Ads' as platform,
1212
cast(date_day as date) as date_day,
1313
account_name,
14-
account_id,
14+
cast(account_id as {{ dbt_utils.type_string() }}) as account_id,
1515
campaign_name,
1616
cast(campaign_id as {{ dbt_utils.type_string() }}) as campaign_id,
1717
ad_group_name,

0 commit comments

Comments
 (0)