Skip to content

Commit

Permalink
Merge pull request #48 from dbt-labs/utils-v1-and-deprecation
Browse files Browse the repository at this point in the history
Updates for utils v1, note deprecation
  • Loading branch information
joellabes committed Dec 6, 2022
2 parents 20f2f8d + 20ed5e2 commit 6db772b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

> ⛔🏚️ This package is obsolete and no longer developed. Fivetran users should use [fivetran/facebook_ads](https://hub.getdbt.com/fivetran/facebook_ads/latest/) instead.

# Facebook Ads

This package models Facebook Ads data.
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'facebook_ads'
version: '0.8.0'
config-version: 2

require-dbt-version: [">=1.0.0", "<2.0.0"]
require-dbt-version: [">=1.3.0", "<2.0.0"]

model-paths: ["models"] # paths with source code to compile
analysis-paths: ["analyses"] # path with analysis files which are compiled, but not run
Expand Down
6 changes: 3 additions & 3 deletions macros/stitch/base/stitch_fb_ad_creatives.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ links_joined as (
)) as url,

lower(coalesce(
nullif(url_tags, {{ dbt_utils.split_part('url', "'?'", 2) }}), '')
nullif(url_tags, {{ dbt.split_part('url', "'?'", 2) }}), '')
) as url_tags

from base
Expand All @@ -47,9 +47,9 @@ parsed as (
select

links_joined.*,
{{ dbt_utils.split_part('url', "'?'", 1) }} as base_url,
{{ dbt.split_part('url', "'?'", 1) }} as base_url,
{{ dbt_utils.get_url_host('url') }} as url_host,
{{ dbt_utils.concat(["'/'", dbt_utils.get_url_path('url')]) }} as url_path,
{{ dbt.concat(["'/'", dbt_utils.get_url_path('url')]) }} as url_path,
{{ facebook_ads.get_url_parameter() }}

from links_joined
Expand Down
2 changes: 1 addition & 1 deletion models/transform/fb_ad_insights_xf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ with ads as (

select

{{ dbt_utils.surrogate_key(['insights.date_day', 'insights.ad_id']) }} as id,
{{ dbt_utils.generate_surrogate_key(['insights.date_day', 'insights.ad_id']) }} as id,
insights.*,
creatives.base_url,
creatives.url,
Expand Down
2 changes: 1 addition & 1 deletion models/transform/fb_ads_xf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ select
when version_number = num_versions then null
else lead(updated_at) over (partition by ad_id order by updated_at)
end as effective_to,
{{ dbt_utils.surrogate_key(['ad_id', 'version_number']) }} as unique_id
{{ dbt_utils.generate_surrogate_key(['ad_id', 'version_number']) }} as unique_id

from ads_xf_windowed
2 changes: 1 addition & 1 deletion packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- package: dbt-labs/dbt_utils
version: [">=0.8.0", "<0.9.0"]
version: [">=1.0.0", "<2.0.0"]

0 comments on commit 6db772b

Please sign in to comment.