Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Upgrade dbt v0.20, dbt-utils v0.7 (#44)
Browse files Browse the repository at this point in the history
* Upgrade dbt v0.20, dbt-utils v0.7

* Update version, company name

* Fixups
  • Loading branch information
jtcohen6 authored Jul 7, 2021
1 parent 0d22310 commit f27cc65
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 27 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ from Facebook's API.
# Installation Instructions

[Here](https://docs.getdbt.com/docs/package-management) is some additional
information about packages in dbt, icnluding installation instructions.
information about packages in dbt, including installation instructions.
If you haven't already, you will need to create a `packages.yml` file in your project.

You should then copy the adwords package structure from the `dbt_project.yml` in
this repository into your project's `dbt_project.yml` file and replace the `#`
values with the adwords table names from your warehouse.
You should then copy these variables into your root `dbt_project.yml`, and fill in with the names of Facebook ads tables in your warehouse:
```
vars:
etl: #stitch or fivetran
ads_table: #table
ad_creatives_table: #table
adsets_table: #table
campaigns_table: #table
ads_insights_table: #table
ad_creatives__child_links_table: #table -- disable if on snowflake
url_tag_table: #only for fivetran
```

## Stitch

Expand Down
4 changes: 2 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'facebook_ads'
version: '0.5.0'
version: '0.7.0'
config-version: 2

require-dbt-version: [">=0.18.0"]
require-dbt-version: [">=0.20.0"]

source-paths: ["models"] # paths with source code to compile
analysis-paths: ["analysis"] # path with analysis files which are compiled, but not run
Expand Down
2 changes: 1 addition & 1 deletion macros/fivetran/base/fivetran_fb_ad_creatives.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro fivetran_fb_ad_creatives() %}

{{ adapter.dispatch('fivetran_fb_ad_creatives', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('fivetran_fb_ad_creatives', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/fivetran/base/fivetran_fb_ad_insights.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro fivetran_fb_ad_insights() %}

{{ adapter.dispatch('fivetran_fb_ad_insights', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('fivetran_fb_ad_insights', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/fivetran/base/fivetran_fb_ads.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro fivetran_fb_ads() %}

{{ adapter.dispatch('fivetran_fb_ads', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('fivetran_fb_ads', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/fivetran/base/fivetran_fb_ads_adsets.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro fivetran_fb_ads_adsets() %}

{{ adapter.dispatch('fivetran_fb_ads_adsets', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('fivetran_fb_ads_adsets', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/fivetran/base/fivetran_fb_campaigns.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro fivetran_fb_ads_campaigns() %}

{{ adapter.dispatch('fivetran_fb_ads_campaigns', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('fivetran_fb_ads_campaigns', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/fivetran/base/fivetran_fb_url_tag.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro fivetran_fb_url_tag() %}

{{adapter.dispatch('fivetran_fb_url_tag', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{adapter.dispatch('fivetran_fb_url_tag', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/fivetran/ignore_nulls.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro ignore_nulls() %}

{{ adapter.dispatch('ignore_nulls', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('ignore_nulls', 'facebook_ads')() }}

{% endmacro %}

Expand Down
4 changes: 0 additions & 4 deletions macros/get_face.sql

This file was deleted.

2 changes: 1 addition & 1 deletion macros/nested_field.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro nested_field(field, subfields) %}

{{ adapter.dispatch('nested_field', packages=facebook_ads._get_facebook_ads_namespaces())(field, subfields) }}
{{ adapter.dispatch('nested_field', 'facebook_ads')(field, subfields) }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/stitch/base/stitch_fb_ad_creatives.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro stitch_fb_ad_creatives() %}

{{ adapter.dispatch('stitch_fb_ad_creatives', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('stitch_fb_ad_creatives', 'facebook_ads')() }}

{% endmacro %}

Expand Down
4 changes: 2 additions & 2 deletions macros/stitch/base/stitch_fb_ad_creatives__child_links.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% macro stitch_fb_ad_creatives__child_links() %}

{{ adapter.dispatch('stitch_fb_ad_creatives__child_links', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('stitch_fb_ad_creatives__child_links', 'facebook_ads')() }}

{% endmacro %}

Expand All @@ -14,7 +14,7 @@

with base as (

select * from {{ var('ad_creatives__child_links_table', packages=facebook_ads._get_facebook_ads_namespaces())() }}
select * from {{ var('ad_creatives__child_links_table') }}

),

Expand Down
2 changes: 1 addition & 1 deletion macros/stitch/base/stitch_fb_ad_insights.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro stitch_fb_ad_insights() %}

{{ adapter.dispatch('stitch_fb_ad_insights', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('stitch_fb_ad_insights', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/stitch/base/stitch_fb_ads.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro stitch_fb_ads() %}

{{ adapter.dispatch('stitch_fb_ads', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('stitch_fb_ads', 'facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/stitch/base/stitch_fb_ads_adsets.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro stitch_fb_ads_adsets() %}

{{ adapter.dispatch('stitch_fb_ads_adsets',packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('stitch_fb_ads_adsets','facebook_ads')() }}

{% endmacro %}

Expand Down
2 changes: 1 addition & 1 deletion macros/stitch/base/stitch_fb_campaigns.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro stitch_fb_ads_campaigns() %}

{{ adapter.dispatch('stitch_fb_ads_campaigns', packages=facebook_ads._get_facebook_ads_namespaces())() }}
{{ adapter.dispatch('stitch_fb_ads_campaigns', 'facebook_ads')() }}

{% endmacro %}

Expand Down
4 changes: 2 additions & 2 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- package: fishtown-analytics/dbt_utils
version: [">=0.6.0", "<0.7.0"]
- package: dbt-labs/dbt_utils
version: [">=0.7.0", "<0.8.0"]

0 comments on commit f27cc65

Please sign in to comment.