Skip to content

Commit

Permalink
Merge pull request #16 from fivetran/updates
Browse files Browse the repository at this point in the history
update package for dbt 0.18.0
  • Loading branch information
fivetran-jamie authored Nov 2, 2020
2 parents a81103e + 3614ad5 commit 96f6278
Show file tree
Hide file tree
Showing 40 changed files with 49 additions and 76 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This package contains staging models, designed to work simultaneously with our [

* Remove any rows that are soft-deleted
* Name columns consistently across all packages:
* Boolean fields are prefixed with is_ or has_
* Boolean fields are prefixed with `is_` or `has_`
* Timestamps are appended with `_timestamp`
* ID primary keys are prefixed with the name of the table. For example, the user table's ID column is renamed user_id.

Expand Down
4 changes: 2 additions & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'hubspot_source'
version: '1.0.0'
version: '0.2.0'
config-version: 2
require-dbt-version: ">=0.17.0"
require-dbt-version: [">=0.18.0", "<0.19.0"]

vars:
hubspot_source:
Expand Down
13 changes: 0 additions & 13 deletions macros/enabled_vars.sql

This file was deleted.

5 changes: 0 additions & 5 deletions macros/full_name.sql

This file was deleted.

12 changes: 0 additions & 12 deletions macros/remove_prefix_from_columns.sql

This file was deleted.

4 changes: 2 additions & 2 deletions models/stg_hubspot__company.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}

{%- set columns = adapter.get_columns_in_relation(ref('stg_hubspot__company_adapter')) -%}

Expand All @@ -12,7 +12,7 @@ with base as (

select
id as company_id,
{{ remove_prefix_from_columns(columns=columns, exclude=['id']) }}
{{ fivetran_utils.remove_prefix_from_columns(columns=columns, prefix='property_', exclude=['id']) }}
from base

)
Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__company_adapter.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}

select *
from {{ var('company') }}
2 changes: 1 addition & 1 deletion models/stg_hubspot__company_property_history.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_company_enabled'])) }}

with base as (

Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__contact.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ with base as (

select *
from {{ ref('stg_hubspot__contact_adapter') }}
where _fivetran_deleted is null
where not coalesce(_fivetran_deleted, false)

), fields as (

select
id as contact_id,
{{ remove_prefix_from_columns(columns=columns, exclude=['id']) }}
{{ fivetran_utils.remove_prefix_from_columns(columns=columns, prefix='property_', exclude=['id']) }}
from base

)
Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__contact_list.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled'])) }}

with base as (

select *
from {{ var('contact_list') }}
where _fivetran_deleted is null
where not coalesce(_fivetran_deleted, false)

), fields as (

Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__contact_list_member.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled'])) }}

with base as (

select *
from {{ var('contact_list_member') }}
where _fivetran_deleted is null
where not coalesce(_fivetran_deleted, false)

), fields as (

Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__deal.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

{%- set columns = adapter.get_columns_in_relation(ref('stg_hubspot__deal_adapter')) -%}

Expand All @@ -11,7 +11,7 @@ with base as (
), fields as (

select
{{ remove_prefix_from_columns(columns=columns) }}
{{ fivetran_utils.remove_prefix_from_columns(columns=columns, prefix='property_') }}
from base

)
Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__deal_adapter.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

select *
from {{ var('deal') }}
4 changes: 2 additions & 2 deletions models/stg_hubspot__deal_pipeline.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with base as (

select *
from {{ var('deal_pipeline')}}
where _fivetran_deleted is null
where not coalesce(_fivetran_deleted, false)

), fields as (

Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__deal_pipeline_stage.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with base as (

select *
from {{ var('deal_pipeline_stage')}}
where _fivetran_deleted is null
where not coalesce(_fivetran_deleted, false)

), fields as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__deal_property_history.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_deal_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_campaign.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_bounce.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_bounce_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_bounce_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_click.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_click_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_click_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_deferred.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_deferred_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_deferred_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_delivered.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_delivered_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_delivered_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_dropped.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_dropped_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_dropped_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_forward.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_forward_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_forward_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_open.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_open_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_open_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_print.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_print_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_print_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_sent.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_sent_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_sent_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_spam_report.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_spam_report_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_spam_report_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__email_event_status_change.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_status_change_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_marketing_enabled','hubspot_email_event_enabled','hubspot_email_event_status_change_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_call.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_call_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_call_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_company.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_company_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_company_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_contact.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_contact_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_contact_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_deal.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_deal_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_deal_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_email.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_email_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_email_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_meeting.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_email_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_email_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_note.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_note_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_note_enabled'])) }}

with base as (

Expand Down
2 changes: 1 addition & 1 deletion models/stg_hubspot__engagement_task.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_task_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_engagement_enabled','hubspot_engagement_task_enabled'])) }}

with base as (

Expand Down
4 changes: 2 additions & 2 deletions models/stg_hubspot__owner.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(enabled=enabled_vars(['hubspot_sales_enabled','hubspot_owner_enabled'])) }}
{{ config(enabled=fivetran_utils.enabled_vars(['hubspot_sales_enabled','hubspot_owner_enabled'])) }}

with base as (

Expand All @@ -17,7 +17,7 @@ with base as (
portal_id,
type as owner_type,
updated_at as updated_timestamp,
{{ full_name('first_name','last_name') }}
trim( {{ dbt_utils.concat(['first_name', "' '", 'last_name']) }} ) as full_name
from base

)
Expand Down
5 changes: 4 additions & 1 deletion packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
packages:
- package: fishtown-analytics/dbt_utils
version: [">=0.4.0"]
version: [">=0.6.0", "<0.7.0"]

- git: "https://github.com/fivetran/dbt_fivetran_utils.git"
warn-unpinned: false

0 comments on commit 96f6278

Please sign in to comment.