diff --git a/.buildkite/scripts/run_models.sh b/.buildkite/scripts/run_models.sh index 88d793e..f85de5c 100644 --- a/.buildkite/scripts/run_models.sh +++ b/.buildkite/scripts/run_models.sh @@ -17,7 +17,7 @@ echo `pwd` cd integration_tests dbt deps dbt seed --target "$db" --full-refresh -dbt run --target "$db" --full-refresh --vars '{ad_reporting__facebook_ads_enabled: true, ad_reporting__google_ads_enabled: true, ad_reporting__amazon_ads_enabled: true, ad_reporting__apple_search_ads_enabled: false, ad_reporting__linkedin_ads_enabled: false, ad_reporting__microsoft_ads_enabled: true, ad_reporting__pinterest_ads_enabled: true, ad_reporting__reddit_ads_enabled: false, ad_reporting__snapchat_ads_enabled: false, ad_reporting__tiktok_ads_enabled: true, ad_reporting__twitter_ads_enabled: true}' -dbt test --target "$db" --vars '{ad_reporting__facebook_ads_enabled: true, ad_reporting__google_ads_enabled: true, ad_reporting__amazon_ads_enabled: true, ad_reporting__apple_search_ads_enabled: false, ad_reporting__linkedin_ads_enabled: false, ad_reporting__microsoft_ads_enabled: true, ad_reporting__pinterest_ads_enabled: true, ad_reporting__reddit_ads_enabled: false, ad_reporting__snapchat_ads_enabled: false, ad_reporting__tiktok_ads_enabled: true, ad_reporting__twitter_ads_enabled: true}' +dbt run --target "$db" --full-refresh --vars '{ad_reporting__facebook_ads_enabled: true, ad_reporting__google_ads_enabled: true, ad_reporting__amazon_ads_enabled: false, ad_reporting__apple_search_ads_enabled: false, ad_reporting__linkedin_ads_enabled: false, ad_reporting__microsoft_ads_enabled: false, ad_reporting__pinterest_ads_enabled: false, ad_reporting__reddit_ads_enabled: false, ad_reporting__snapchat_ads_enabled: true, ad_reporting__tiktok_ads_enabled: false, ad_reporting__twitter_ads_enabled: false}' +dbt test --target "$db" --vars '{ad_reporting__facebook_ads_enabled: true, ad_reporting__google_ads_enabled: true, ad_reporting__amazon_ads_enabled: false, ad_reporting__apple_search_ads_enabled: false, ad_reporting__linkedin_ads_enabled: false, ad_reporting__microsoft_ads_enabled: false, ad_reporting__pinterest_ads_enabled: false, ad_reporting__reddit_ads_enabled: false, ad_reporting__snapchat_ads_enabled: true, ad_reporting__tiktok_ads_enabled: false, ad_reporting__twitter_ads_enabled: false}' dbt run-operation fivetran_utils.drop_schemas_automation --target "$db" diff --git a/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md index 03d0935..a75d509 100644 --- a/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md @@ -4,54 +4,33 @@ **This PR will result in the following new package version:** -**Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:** +**Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:** + ## PR Checklist ### Basic Validation Please acknowledge that you have successfully performed the following commands locally: -- [ ] dbt compile -- [ ] dbt run –full-refresh -- [ ] dbt run -- [ ] dbt test -- [ ] dbt run –vars (if applicable) +- [ ] dbt run –full-refresh && dbt test +- [ ] dbt run (if incremental models are present) && dbt test Before marking this PR as "ready for review" the following have been applied: -- [ ] The appropriate issue has been linked and tagged -- [ ] You are assigned to the corresponding issue and this PR +- [ ] The appropriate issue has been linked, tagged, and properly assigned +- [ ] All necessary documentation and version upgrades have been applied + +- [ ] docs were regenerated (unless this PR does not include any code or yml updates) - [ ] BuildKite integration tests are passing +- [ ] Detailed validation steps have been provided below -### Detailed Validation -Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review": -- [ ] You have validated these changes and assure this PR will address the respective Issue/Feature. -- [ ] You are reasonably confident these changes will not impact any other components of this package or any dependent packages. -- [ ] You have provided details below around the validation steps performed to gain confidence in these changes. - - -### Standard Updates -Please acknowledge that your PR contains the following standard updates: -- Package versioning has been appropriately indexed in the following locations: - - [ ] indexed within dbt_project.yml - - [ ] indexed within integration_tests/dbt_project.yml -- [ ] CHANGELOG has individual entries for each respective change in this PR - -- [ ] README updates have been applied (if applicable) - -- [ ] DECISIONLOG updates have been updated (if applicable) -- [ ] Appropriate yml documentation has been added (if applicable) - -### ❗ Special Updates for Ad Reporting ❗ +#### ❗ Special Updates for Ad Reporting ❗ To reduce integration testing time, not all models should be enabled in the `run_models.sh` vars. Update the variables after `dbt run` and `dbt test` to set: - [ ] this PR's package to `true` - [ ] Google Ads and Facebook Ads to `true` (if not already) - [ ] All other packages to `false` -### dbt Docs -Please acknowledge that after the above were all completed the below were applied to your branch: -- [ ] docs were regenerated (unless this PR does not include any code or yml updates) +### Detailed Validation +Please share any and all of your validation steps: + ### If you had to summarize this PR in an emoji, which would it be? -:dancer: +:dancer: \ No newline at end of file diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml new file mode 100644 index 0000000..8ed5853 --- /dev/null +++ b/.github/workflows/auto-release.yml @@ -0,0 +1,13 @@ +name: 'auto release' +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + call-workflow-passing-data: + if: github.event.pull_request.merged + uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main + secrets: inherit \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b926d29..24dcf07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# dbt_ad_reporting v1.7.1 +## Bug Fixes +- Adjust the severity of the `account_id` test in `ad_reporting__account_report` to `warn`. This is required since Snapchat can hard-delete records from the history tables, but not from the reporting tables. This ensures that accurate statistics are being reported and production pipelines aren't failing. ([PR #20](https://github.com/fivetran/dbt_snapchat_ads/pull/20)) + - Documents the above decision in the [DECISIONLOG.md](https://github.com/fivetran/dbt_ad_reporting/blob/main/DECISIONLOG.md). + +## Under the Hood +- Updated the pull request [templates](/.github) ([PR #110](https://github.com/fivetran/dbt_ad_reporting/pull/110)). +- Included auto-releaser GitHub Actions workflow to automate future releases ([PR #110](https://github.com/fivetran/dbt_ad_reporting/pull/110)). + +## Contributors +- [@bthomson22](https://github.com/bthomson22) ([PR #20](https://github.com/fivetran/dbt_snapchat_ads/pull/20)) + # dbt_ad_reporting v1.7.0 [PR #103](https://github.com/fivetran/dbt_ad_reporting/pull/103) includes the following update. diff --git a/DECISIONLOG.md b/DECISIONLOG.md index e83537e..0f58667 100644 --- a/DECISIONLOG.md +++ b/DECISIONLOG.md @@ -12,5 +12,22 @@ Account └── Keyword ``` Where Account > Campaign > Ad Group > Ad and Search and Keyword reports are created at the Ad Group Level. Depending on the platform, URL reports can be at the Ad Level or the Ad Group level so we have made the decision to provide only reporting at the Ad Group level to be inclusive of all our platforms. + ### Linkedin Campaign Group and Campaign Mapping -Linkedin's "campaign group" reporting is the equivalent to all other platforms' "campaign" reporting; similarly, Linkedin's "campaign" reporting is equivalent to all other platforms' "ad group" reporting. Therefore, the Ad Reporting campaign model and ad group model each reflect the proper roll up for Linkedin with respects to other platforms. \ No newline at end of file +Linkedin's "campaign group" reporting is the equivalent to all other platforms' "campaign" reporting; similarly, Linkedin's "campaign" reporting is equivalent to all other platforms' "ad group" reporting. Therefore, the Ad Reporting campaign model and ad group model each reflect the proper roll up for Linkedin with respects to other platforms. + +### Snapchat Ad Account Report Metrics Associated with Deleted Entities +Snapchat Ads will hard-delete entities (i.e. ads, ad squads, campaigns, accounts) from their `*_history` tables but retain associated records in their respective `*_hourly_report` tables. This typically does not pose an issue for our `not_null` tests on our Ad Reporting and Snapchat Ads end models, as most entities have their own `_hourly_report` source tables that come with the appropriate entity-level ID. However, `snapchat_ads__account_report` (and the downstream `ad_reporting__account_report` model) draws from the Snapchat `ad_hourly_report` table, rolls it up to the account level, and joins in the ad `account_id` using history tables. Thus, if any ad report record is associated with a deleted ad, campaign, ad squad, or account, the ad `account_id` will be `null`. + +We have opted to keep these records in `snapchat_ads__account_report` and `ad_reporting__account_report`, as it may be valuable to know that non-zero ad metrics are associated with deleted entities (though null-account Snapchat records will be grouped together). However, we have changed the severity of the `not_null` test on ad `account_id` to be `warn` instead of `error`. + +If you would like to disable this `not_null` test completely to avoid warnings, add the following to your root project `dbt_project.yml`: +```yml +tests: + snapchat_ads: + not_null_snapchat_ads__account_report_ad_account_id: + +enabled: false + ad_reporting: + not_null_ad_reporting__account_report_account_id: + +enabled: false +``` \ No newline at end of file diff --git a/dbt_project.yml b/dbt_project.yml index b7104d1..19211d6 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'ad_reporting' -version: '1.7.0' +version: '1.7.1' config-version: 2 diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 5b5f730..89edfdd 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'ad_reporting_integration_tests' -version: '1.7.0' +version: '1.7.1' profile: 'integration_tests' config-version: 2 diff --git a/models/ad_reporting_models.yml b/models/ad_reporting_models.yml index 7613c6f..1de7c2e 100644 --- a/models/ad_reporting_models.yml +++ b/models/ad_reporting_models.yml @@ -21,7 +21,9 @@ models: - name: account_id description: '{{ doc("account_id") }}' tests: - - not_null + - not_null: + config: + severity: warn - name: account_name description: '{{ doc("account_name") }}' - name: clicks