diff --git a/.gitignore b/.gitignore index 06f4e77..af429d7 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,4 @@ env/ env.bak/ venv/ venv.bak/ +dbt_internal_packages/ diff --git a/dbt_project.yml b/dbt_project.yml index d27b31c..40ef906 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,8 +1,8 @@ name: 'reddit_ads_source' -version: '0.7.0' - +version: '0.8.0' config-version: 2 -require-dbt-version: [">=1.3.0", "<2.0.0"] +profile: 'default' +require-dbt-version: [">=1.10.6"] models: reddit_ads_source: @@ -37,4 +37,8 @@ vars: reddit_ads__campaign_passthrough_metrics: [] reddit_ads__campaign_conversions_passthrough_metrics: [] reddit_ads__campaign_country_passthrough_metrics: [] - reddit_ads__campaign_country_conversions_passthrough_metrics: [] \ No newline at end of file + reddit_ads__campaign_country_conversions_passthrough_metrics: [] + +flags: + require_generic_test_arguments_property: true + diff --git a/models/src_reddit_ads.yml b/models/src_reddit_ads.yml index 218d71f..29dee3b 100644 --- a/models/src_reddit_ads.yml +++ b/models/src_reddit_ads.yml @@ -4,15 +4,13 @@ sources: - name: reddit_ads # This source will only be used if you are using a single reddit_ads source connector. If multiple sources are being unioned, their tables will be directly referenced via adapter.get_relation. schema: "{{ var('reddit_ads_schema', 'reddit_ads') }}" database: "{% if target.type != 'spark'%}{{ var('reddit_ads_database', target.database) }}{% endif %}" - loader: Fivetran - loaded_at_field: _fivetran_synced - config: enabled: "{{ var('ad_reporting__reddit_ads_enabled', true) }}" - freshness: + freshness: warn_after: {count: 48, period: hour} error_after: {count: 168, period: hour} + loaded_at_field: _fivetran_synced tables: - name: account @@ -376,7 +374,6 @@ sources: description: '{{ doc("view_through_conversion_attribution_window_day") }}' - name: view_through_conversion_attribution_window_week description: '{{ doc("view_through_conversion_attribution_window_week") }}' - - name: ad_group_conversions_report identifier: '{{ var("reddit_ads_ad_group_conversions_report_identifier", "ad_group_conversions_report") }}' description: '{{ doc("ad_group_conversions_report") }}' diff --git a/models/stg_reddit_ads.yml b/models/stg_reddit_ads.yml index aa0d1f7..5be2f64 100644 --- a/models/stg_reddit_ads.yml +++ b/models/stg_reddit_ads.yml @@ -4,9 +4,10 @@ models: - name: stg_reddit_ads__account tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - account_id + arguments: + combination_of_columns: + - source_relation + - account_id description: Each record in this table represents information about an account. columns: - name: source_relation @@ -33,10 +34,11 @@ models: - name: stg_reddit_ads__account_report tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - account_id - - date_day + arguments: + combination_of_columns: + - source_relation + - account_id + - date_day description: Each record represents a summary of events for each given date and account. columns: - name: source_relation @@ -59,9 +61,10 @@ models: - name: stg_reddit_ads__ad tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - ad_id + arguments: + combination_of_columns: + - source_relation + - ad_id description: Each record represents information about each ad. columns: - name: source_relation @@ -96,10 +99,11 @@ models: - name: stg_reddit_ads__ad_report tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - ad_id - - date_day + arguments: + combination_of_columns: + - source_relation + - ad_id + - date_day description: Each record represents a summary of events for each given date and ad. columns: - name: source_relation @@ -124,9 +128,10 @@ models: - name: stg_reddit_ads__ad_group tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - ad_group_id + arguments: + combination_of_columns: + - source_relation + - ad_group_id description: Each record represents information about each ad group. columns: - name: source_relation @@ -167,10 +172,11 @@ models: - name: stg_reddit_ads__ad_group_report tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - ad_group_id - - date_day + arguments: + combination_of_columns: + - source_relation + - ad_group_id + - date_day description: Each record represents a summary of events for each given date and ad group. columns: - name: source_relation @@ -195,9 +201,10 @@ models: - name: stg_reddit_ads__campaign tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - campaign_id + arguments: + combination_of_columns: + - source_relation + - campaign_id description: Each record represents information about each campaign. columns: - name: source_relation @@ -224,10 +231,11 @@ models: - name: stg_reddit_ads__campaign_report tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - campaign_id - - date_day + arguments: + combination_of_columns: + - source_relation + - campaign_id + - date_day description: Each record represents a summary of events for each given date and campaign. columns: - name: source_relation @@ -252,11 +260,12 @@ models: description: '{{ doc("stg_reddit_ads__account_conversions_report") }}' tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - account_id - - date_day - - event_name + arguments: + combination_of_columns: + - source_relation + - account_id + - date_day + - event_name columns: - name: account_id description: '{{ doc("account_id") }}' @@ -281,11 +290,12 @@ models: description: '{{ doc("stg_reddit_ads__ad_group_conversions_report") }}' tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - ad_group_id - - date_day - - event_name + arguments: + combination_of_columns: + - source_relation + - ad_group_id + - date_day + - event_name columns: - name: account_id description: '{{ doc("account_id") }}' @@ -312,11 +322,12 @@ models: description: '{{ doc("stg_reddit_ads__ad_conversions_report") }}' tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - ad_id - - date_day - - event_name + arguments: + combination_of_columns: + - source_relation + - ad_id + - date_day + - event_name columns: - name: account_id description: '{{ doc("account_id") }}' @@ -343,11 +354,12 @@ models: description: '{{ doc("stg_reddit_ads__campaign_conversions_report") }}' tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - campaign_id - - date_day - - event_name + arguments: + combination_of_columns: + - source_relation + - campaign_id + - date_day + - event_name columns: - name: account_id description: '{{ doc("account_id") }}' @@ -374,12 +386,13 @@ models: description: '{{ doc("campaign_country_report") }}' tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - account_id - - campaign_id - - country - - date_day + arguments: + combination_of_columns: + - source_relation + - account_id + - campaign_id + - country + - date_day columns: - name: account_id description: '{{ doc("account_id") }}' @@ -408,13 +421,14 @@ models: description: '{{ doc("campaign_country_conversions_report") }}' tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - account_id - - campaign_id - - country - - date_day - - event_name + arguments: + combination_of_columns: + - source_relation + - account_id + - campaign_id + - country + - date_day + - event_name columns: - name: account_id description: '{{ doc("account_id") }}' diff --git a/packages.yml b/packages.yml index 908f471..59f3753 100644 --- a/packages.yml +++ b/packages.yml @@ -1,5 +1,5 @@ packages: - package: fivetran/fivetran_utils - version: [">=0.4.0", "<0.5.0"] + version: [">=0.5.0", "<0.6.0"] - package: dbt-labs/spark_utils version: [">=0.3.0", "<0.4.0"]