diff --git a/CHANGELOG.md b/CHANGELOG.md index 93626e2..d00d65e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# dbt_hubspot v0.5.2 +## Under the Hood +- Updated the `engagements_joined` [macro](https://github.com/fivetran/dbt_hubspot/blob/main/macros/engagements_joined.sql) to conditionally include relevant fields if their respective variables are enabled. Previously if a variable was disabled then the `hubspot__engagement_calls` model, which depends on the `engagements_joined` macro, would error out on the missing fields that were from the disabled variables. ([#65](https://github.com/fivetran/dbt_hubspot/pull/65)) + # dbt_hubspot v0.5.1 ## Under the Hood - Modified the join conditions within the `deal_fields_joined` cte of int_hubspot__deals_enhanced model to leverage the more appropriate `left join` rather than the `using` condition. This is to allow for correct and accurate joins across warehouses. ([#60](https://github.com/fivetran/dbt_hubspot/pull/60)) diff --git a/dbt_project.yml b/dbt_project.yml index 009b4e7..06e2462 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'hubspot' -version: '0.5.1' +version: '0.5.2' config-version: 2 require-dbt-version: [">=1.0.0", "<2.0.0"] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 9ad075d..744ebc8 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,6 +1,6 @@ name: 'hubspot_integration_tests' -version: '0.5.1' +version: '0.5.2' profile: 'integration_tests' config-version: 2 diff --git a/macros/engagements_joined.sql b/macros/engagements_joined.sql index fb6e594..aafb35a 100644 --- a/macros/engagements_joined.sql +++ b/macros/engagements_joined.sql @@ -14,13 +14,13 @@ with base as ( select base.*, + {% if fivetran_utils.enabled_vars(['hubspot_engagement_contact_enabled']) %} engagements.contact_ids, {% endif %} + {% if fivetran_utils.enabled_vars(['hubspot_engagement_deal_enabled']) %} engagements.deal_ids, {% endif %} + {% if fivetran_utils.enabled_vars(['hubspot_engagement_company_enabled']) %} engagements.company_ids, {% endif %} engagements.is_active, engagements.created_timestamp, engagements.occurred_timestamp, - engagements.owner_id, - engagements.contact_ids, - engagements.deal_ids, - engagements.company_ids + engagements.owner_id from base left join engagements using (engagement_id)