Skip to content
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

Feature/enable null urls #25

Merged
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ steps:
commands: |
bash .buildkite/scripts/run_models.sh redshift

- label: ":bricks: Run Tests - Databricks"
- label: ":databricks: Run Tests - Databricks"
key: "run_dbt_databricks"
plugins:
- docker#v3.13.0:
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ cd integration_tests
dbt deps
dbt seed --target "$db" --full-refresh
dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt test --target "$db"
dbt run --vars '{ad_reporting__url_report__using_null_filter: false}' --target "$db" --full-refresh
dbt test --vars '{ad_reporting__url_report__using_null_filter: false}' --target "$db"
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# dbt_facebook_ads v0.6.1
[PR #25](https://github.com/fivetran/dbt_facebook_ads/pull/25) includes the following changes:
fivetran-sheringuyen marked this conversation as resolved.
Show resolved Hide resolved
## 🎉 Features 🎉
- For use in the [dbt_ad_reporting package](https://github.com/fivetran/dbt_ad_reporting), users can now allow records having nulls in url fields to be included in the `ad_reporting__url_report` model. See the [dbt_ad_reporting README](https://github.com/fivetran/dbt_ad_reporting) for more details.
fivetran-sheringuyen marked this conversation as resolved.
Show resolved Hide resolved
## 🚘 Under the Hood 🚘
- Disabled the `not_null` test for `facebook_ads__url_report` when null urls are allowed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job on including this!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you like consistency, so I just moved the PR references to the end of each section like below:

Suggested change
- Disabled the `not_null` test for `facebook_ads__url_report` when null urls are allowed.
- Disabled the `not_null` test for `facebook_ads__url_report` when null urls are allowed [[#25](https://github.com/fivetran/dbt_facebook_ads/pull/25)].


# dbt_facebook_ads v0.6.0

## 🚨 Breaking Changes 🚨:
Expand Down
7 changes: 5 additions & 2 deletions models/facebook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ models:
- name: creative_id
description: The ID of the related creative.
- name: creative_name
description: The name of the related creative.
description: The name of the related creative.
- name: base_url
description: The base URL of the ad, extracted from the page_link and template_page_link.
tests:
- not_null
- not_null:
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) }}"
- name: url_host
description: The URL host of the ad, extracted from the page_link and template_page_link.
- name: url_path
Expand Down
8 changes: 6 additions & 2 deletions models/facebook_ads__url_report.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ joined as (
left join campaigns
on ads.campaign_id = campaigns.campaign_id
left join accounts
on report.account_id = accounts.account_id
where creatives.url is not null
on report.account_id = accounts.account_id

{% if var('ad_reporting__url_report__using_null_filter', True) %}
where creatives.url is not null
{% endif %}

{{ dbt_utils.group_by(19) }}
)

Expand Down