From f19b3ec4e8abde6cc8cda220f40f11c1c00f9dbf Mon Sep 17 00:00:00 2001 From: Anders Swanson Date: Thu, 7 Aug 2025 16:34:13 -0400 Subject: [PATCH] test arguments --- .gitignore | 3 +- dbt_project.yml | 9 +- integration_tests/dbt_project.yml | 5 +- models/linkedin.yml | 185 +++++++++++++++--------------- packages.yml | 2 +- 5 files changed, 104 insertions(+), 100 deletions(-) diff --git a/.gitignore b/.gitignore index 4b29589..d7b5d9e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ dbt_modules/ logs/ .DS_Store dbt_packages/ -package-lock.yml \ No newline at end of file +package-lock.yml +dbt_internal_packages/ diff --git a/dbt_project.yml b/dbt_project.yml index e62dc1f..ef97b53 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,7 +1,8 @@ name: 'linkedin' -version: '0.12.0' +version: '0.13.0' config-version: 2 -require-dbt-version: [">=1.3.0", "<2.0.0"] +profile: 'default' +require-dbt-version: [">=1.10.6"] vars: linkedin: ad_analytics_by_creative: "{{ ref('stg_linkedin_ads__ad_analytics_by_creative') }}" @@ -23,3 +24,7 @@ models: linkedin: +materialized: table +schema: linkedin_ads + +flags: + require_generic_test_arguments_property: true + diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 665dd2e..1d33cca 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'linkedin_integration_tests' -version: '0.12.0' +version: '0.13.0' profile: 'integration_tests' config-version: 2 @@ -63,3 +63,6 @@ seeds: dispatch: - macro_namespace: dbt_utils search_order: ['spark_utils', 'dbt_utils'] + +flags: + require_generic_test_arguments_property: true \ No newline at end of file diff --git a/models/linkedin.yml b/models/linkedin.yml index 710e19a..f82a392 100644 --- a/models/linkedin.yml +++ b/models/linkedin.yml @@ -6,10 +6,11 @@ models: description: Each record in this table represents the daily performance of ads at the account level. tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - date_day - - account_id + arguments: + combination_of_columns: + - source_relation + - date_day + - account_id columns: - name: source_relation description: "{{ doc('source_relation') }}" @@ -77,12 +78,13 @@ models: description: Each record in this table represents the daily performance of ads at the campaign level. tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - date_day - - campaign_id - - account_id - - campaign_group_id + arguments: + combination_of_columns: + - source_relation + - date_day + - campaign_id + - account_id + - campaign_group_id columns: - name: source_relation description: "{{ doc('source_relation') }}" @@ -131,7 +133,7 @@ models: PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data. - + - name: last_modified_at description: The timestamp of when the version was updated. @@ -157,13 +159,13 @@ models: - name: daily_budget_amount description: Maximum amount to spend per day UTC. The amount of money as a real number string. - + - name: daily_budget_currency_code description: ISO currency code. The currency must match that of the parent account. - + - name: format description: The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07 - + - name: locale_country description: Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166. @@ -183,8 +185,7 @@ models: - name: is_offsite_delivery_enabled description: > - Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the - LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022) + Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022) - name: optimization_target_type description: Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'. @@ -195,7 +196,7 @@ models: - name: run_schedule_end_at description: > Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided. - + - name: campaign_status description: | ACTIVE - Denotes that the campaign is fully servable. @@ -213,17 +214,14 @@ models: SPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed. SPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox. DYNAMIC - Ads that are dynamically personalized. - + - name: unit_cost_amount description: > - This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, - impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. - The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account. + This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account. - name: unit_cost_currency_code description: > - Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. - ISO currency code. + Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code. - name: currency description: The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default). @@ -236,7 +234,7 @@ models: - name: external_website_conversions description: The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads. - + - name: one_click_leads description: Leads submitted after clicking on LinkedIn ads. @@ -244,11 +242,12 @@ models: description: Each record in this table represents the daily performance of ads at the campaign group level. tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - date_day - - campaign_group_id - - account_id + arguments: + combination_of_columns: + - source_relation + - date_day + - campaign_group_id + - account_id columns: - name: source_relation description: "{{ doc('source_relation') }}" @@ -283,10 +282,10 @@ models: - name: last_modified_at description: The timestamp of when the version was updated. - + - name: created_at description: The timestamp of when the campaign group was created. - + - name: is_backfilled description: Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false. @@ -294,8 +293,8 @@ models: description: Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required. - name: run_schedule_end_at - description: Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date. - + description: Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date. + - name: status description: > Status of campaign group. Possible values are: @@ -306,7 +305,7 @@ models: PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data. - + - name: currency description: The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default). @@ -318,7 +317,7 @@ models: - name: external_website_conversions description: The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads. - + - name: one_click_leads description: Leads submitted after clicking on LinkedIn ads. @@ -326,13 +325,14 @@ models: description: Each record in this table represents the daily performance of ads at the creative level. tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - date_day - - creative_id - - campaign_id - - campaign_group_id - - account_id + arguments: + combination_of_columns: + - source_relation + - date_day + - creative_id + - campaign_id + - campaign_group_id + - account_id columns: - name: source_relation description: "{{ doc('source_relation') }}" @@ -404,7 +404,7 @@ models: PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data. - + - name: campaign_status description: | ACTIVE - Denotes that the campaign is fully servable. @@ -427,7 +427,7 @@ models: - name: external_website_conversions description: The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads. - + - name: one_click_leads description: Leads submitted after clicking on LinkedIn ads. @@ -435,16 +435,17 @@ models: description: Each record in this table represents the daily performance of ads at the url level. tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - date_day - - creative_id - - campaign_id - - campaign_group_id - - account_id config: # Below is so we don't run this test if the user has allowed urls to have null entries enabled: "{{ var('ad_reporting__url_report__using_null_filter', true) }}" + arguments: + combination_of_columns: + - source_relation + - date_day + - creative_id + - campaign_id + - campaign_group_id + - account_id columns: - name: source_relation description: "{{ doc('source_relation') }}" @@ -514,7 +515,7 @@ models: - name: utm_term description: The utm_term parameter of the ad, extracted from the `click_uri`. - + - name: currency description: The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default). @@ -532,7 +533,7 @@ models: - name: external_website_conversions description: The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads. - + - name: one_click_leads description: Leads submitted after clicking on LinkedIn ads. @@ -540,13 +541,14 @@ models: description: Each record in this table represents the monthly performance of a campaign at the country level. tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - date_month - - country_name - - campaign_id - - account_id - - campaign_group_id + arguments: + combination_of_columns: + - source_relation + - date_month + - country_name + - campaign_id + - account_id + - campaign_group_id columns: - name: source_relation description: "{{ doc('source_relation') }}" @@ -598,7 +600,7 @@ models: PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data. - + - name: last_modified_at description: The timestamp of when the version was updated. @@ -624,13 +626,13 @@ models: - name: daily_budget_amount description: Maximum amount to spend per day UTC. The amount of money as a real number string. - + - name: daily_budget_currency_code description: ISO currency code. The currency must match that of the parent account. - + - name: format description: The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07 - + - name: campaign_locale_country description: Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166. @@ -650,8 +652,7 @@ models: - name: is_offsite_delivery_enabled description: > - Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the - LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022) + Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022) - name: optimization_target_type description: Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'. @@ -662,7 +663,7 @@ models: - name: run_schedule_end_at description: > Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided. - + - name: campaign_status description: | ACTIVE - Denotes that the campaign is fully servable. @@ -680,17 +681,14 @@ models: SPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed. SPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox. DYNAMIC - Ads that are dynamically personalized. - + - name: unit_cost_amount description: > - This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, - impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. - The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account. + This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account. - name: unit_cost_currency_code description: > - Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. - ISO currency code. + Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code. - name: account_currency description: The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default). @@ -703,7 +701,7 @@ models: - name: external_website_conversions description: The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads. - + - name: one_click_leads description: Leads submitted after clicking on LinkedIn ads. @@ -711,13 +709,14 @@ models: description: Each record in this table represents the monthly performance of a campaign at the country level. tests: - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - source_relation - - date_month - - region_name - - campaign_id - - account_id - - campaign_group_id + arguments: + combination_of_columns: + - source_relation + - date_month + - region_name + - campaign_id + - account_id + - campaign_group_id columns: - name: source_relation description: "{{ doc('source_relation') }}" @@ -769,7 +768,7 @@ models: PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data. - + - name: last_modified_at description: The timestamp of when the version was updated. @@ -795,13 +794,13 @@ models: - name: daily_budget_amount description: Maximum amount to spend per day UTC. The amount of money as a real number string. - + - name: daily_budget_currency_code description: ISO currency code. The currency must match that of the parent account. - + - name: format description: The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07 - + - name: campaign_locale_country description: Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166. @@ -821,8 +820,7 @@ models: - name: is_offsite_delivery_enabled description: > - Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the - LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022) + Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022) - name: optimization_target_type description: Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'. @@ -833,7 +831,7 @@ models: - name: run_schedule_end_at description: > Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided. - + - name: campaign_status description: | ACTIVE - Denotes that the campaign is fully servable. @@ -851,17 +849,14 @@ models: SPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed. SPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox. DYNAMIC - Ads that are dynamically personalized. - + - name: unit_cost_amount description: > - This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, - impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. - The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account. + This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account. - name: unit_cost_currency_code description: > - Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. - ISO currency code. + Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code. - name: account_currency description: The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default). @@ -874,6 +869,6 @@ models: - name: external_website_conversions description: The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads. - + - name: one_click_leads description: Leads submitted after clicking on LinkedIn ads. \ No newline at end of file diff --git a/packages.yml b/packages.yml index 6bf9372..38faace 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - package: fivetran/linkedin_source - version: [">=0.12.0", "<0.13.0"] \ No newline at end of file + version: [">=0.13.0", "<0.14.0"] \ No newline at end of file