-
Notifications
You must be signed in to change notification settings - Fork 34
Feature/url tags super #65
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
Changes from all commits
2aeb5e0
c8b9210
780730d
cf910ac
ef2f274
f96beb2
392ea77
aa86467
340f5ba
b7f2154
3c8a909
b680a1a
9e46306
b06ccb9
5dfb56a
1a497f2
85445d5
7c8d3db
12a9c69
f49e410
c8da679
d81d5ff
df7c681
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| name: 'facebook_ads_integration_tests' | ||
| version: '1.4.0' | ||
| version: '1.4.1' | ||
| profile: 'integration_tests' | ||
| config-version: 2 | ||
|
|
||
|
|
@@ -40,34 +40,97 @@ vars: | |
| where_sql: source_relation != 'no_purchase_source' # @docs-ignore | ||
|
|
||
| models: | ||
| +persist_docs: | ||
| relation: true | ||
| columns: "{{ false if target.type in ('databricks') else true }}" | ||
| +schema: "facebook_ads_{{ var('directed_schema','dev') }}" | ||
|
|
||
| seeds: | ||
| +docs: | ||
| show: false | ||
| facebook_ads_integration_tests: | ||
| +column_types: | ||
| id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| campaign_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| ad_set_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| ad_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| creative_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| template_page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| _fivetran_synced: "timestamp" | ||
| updated_time: "timestamp" | ||
|
Comment on lines
-49
to
-59
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Broke these out to individual tables to clean up the buildkite messages. |
||
| facebook_ads_account_history_data: | ||
| +column_types: | ||
| id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| facebook_ads_ad_history_data: | ||
| +column_types: | ||
| id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| campaign_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| ad_set_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| creative_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| updated_time: "timestamp" | ||
| facebook_ads_ad_set_history_data: | ||
| +column_types: | ||
| id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| campaign_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| updated_time: "timestamp" | ||
| facebook_ads_campaign_history_data: | ||
| +column_types: | ||
| id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| updated_time: "timestamp" | ||
| facebook_ads_creative_history_data: | ||
| +column_types: | ||
| id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| template_page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| _fivetran_synced: "timestamp" | ||
| url_tags: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| facebook_ads_creative_history_json_data: | ||
| +enabled: "{{ target.type in ('bigquery', 'redshift', 'postgres', 'snowflake') }}" # @docs-ignore | ||
| # +enabled: false # @docs-include | ||
| +column_types: | ||
| id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| template_page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| _fivetran_synced: "timestamp" | ||
| url_tags_string: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}" | ||
| # Load as VARCHAR first, then convert to native JSON type in a post-hook. | ||
| # This is necessary for testing native JSON datatypes with seed data. | ||
| +post-hook: | ||
| - "alter table {{ this }} add column url_tags {{ 'super' if target.type == 'redshift' else 'variant' if target.type == 'snowflake' else 'json' }} {{ 'default null' if target.type != 'bigquery' }}" | ||
| - "update {{ this }} set url_tags = {{ 'json_parse(url_tags_string)' if target.type == 'redshift' else 'url_tags_string::jsonb' if target.type == 'postgres' else 'parse_json(url_tags_string)' }} {{ 'where url_tags_string is not null' if target.type == 'bigquery' }}" | ||
|
Comment on lines
+96
to
+100
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah so just for my reference, does dbt not support configuring
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fivetran-jamie good question! dbt does support it, but when I seeded directly to a JSON type, the seeds consistently ended up with unexpected characters. Also Snowflake just consistently error with the Variant type. This approach was the most reliable way I found to avoid introducing those characters. I also validated the resulting seeded table against the connector data sourced from JSON to make sure the extra characters shouldn't be there. |
||
| facebook_ads_basic_ad_data: | ||
| +column_types: | ||
| ad_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| facebook_ads_basic_ad_actions_data: | ||
| +column_types: | ||
| ad_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| value: "float" | ||
| inline: "float" | ||
| _1_d_view: "float" | ||
| _7_d_click: "float" | ||
| facebook_ads_basic_ad_action_values_data: | ||
| +column_types: | ||
| ad_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| facebook_ads_demographics_country_data: | ||
| +column_types: | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| facebook_ads_demographics_country_actions_data: | ||
| +column_types: | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| value: "float" | ||
| facebook_ads_demographics_region_data: | ||
| +column_types: | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| facebook_ads_demographics_region_actions_data: | ||
| +column_types: | ||
| account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}" | ||
| _fivetran_synced: "timestamp" | ||
| value: "float" | ||
|
|
||
| dispatch: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is to test both string and json versions of
url_tags.