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 #24

Merged
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
5 changes: 2 additions & 3 deletions .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ dbt seed --target "$db" --full-refresh
dbt run --target "$db" --full-refresh
dbt test --target "$db"
## UPDATE FOR VARS HERE, IF NO VARS, PLEASE REMOVE
dbt run --vars '{linkedin_ads__use_local_currency: True}' --target "$db" --full-refresh
dbt test --target "$db"
### END VARS CHUNK, REMOVE IF NOT USING
dbt run --vars '{linkedin_ads__use_local_currency: true, ad_reporting__url_report__using_null_filter: false}' --target "$db" --full-refresh
dbt test --vars '{linkedin_ads__use_local_currency: true, ad_reporting__url_report__using_null_filter: false}' --target "$db"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
- `dbt.current_timestamp_in_utc_backcompat`
- `packages.yml` has been updated to reflect new default `fivetran/fivetran_utils` version, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`.

## 🎉 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 ([#24](https://github.com/fivetran/dbt_linkedin/pull/24)).
## 🚘 Under the Hood 🚘
- Disabled the `not_null` test for `linkedin_ads__url_report` when null urls are allowed ([#24](https://github.com/fivetran/dbt_linkedin/pull/24)).

# dbt_linkedin v0.5.0

PR [#21](https://github.com/fivetran/dbt_linkedin/pull/21) includes the following changes:
Expand Down
8 changes: 8 additions & 0 deletions models/linkedin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ models:
- 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) }}"
columns:
- name: account_name
description: A label for the account.
Expand Down Expand Up @@ -431,6 +434,11 @@ models:
description: |
Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters.
Limit does not include the "https://" prefix.
tests:
- 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: base_url
description: The base URL of the ad, extracted from the `click_uri`.
Expand Down
4 changes: 3 additions & 1 deletion models/linkedin_ads__url_report.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ final as (
left join account
on campaign.account_id = account.account_id

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

{{ dbt_utils.group_by(n=19) }}

Expand Down