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

bug/owner-variable #129

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dbt run --vars '{hubspot_service_enabled: true, hubspot_marketing_enabled: true,
dbt run --vars '{hubspot_service_enabled: true, hubspot_marketing_enabled: true, hubspot_sales_enabled: false}' --target "$db"
dbt test --target "$db"
dbt run --vars '{hubspot_marketing_enabled: true, hubspot_contact_merge_audit_enabled: true, hubspot_sales_enabled: false}' --target "$db" --full-refresh
dbt run --vars '{hubspot_marketing_enabled: false, hubspot_sales_enabled: true, hubspot__pass_through_all_columns: true, hubspot_using_all_email_events: false}' --target "$db" --full-refresh
dbt run --vars '{hubspot_marketing_enabled: false, hubspot_sales_enabled: true, hubspot__pass_through_all_columns: true, hubspot_using_all_email_events: false, hubspot_owner_enabled: false}' --target "$db" --full-refresh
dbt test --target "$db"

dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"
13 changes: 13 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'auto release'
on:
pull_request:
types:
- closed
branches:
- main

jobs:
call-workflow-passing-data:
if: github.event.pull_request.merged
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
secrets: inherit
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# dbt_hubspot v0.15.1
[PR #129](https://github.com/fivetran/dbt_hubspot/pull/129) includes the following updates:

## Bug Fixes
- Updated model `int_hubspot__deals_enhanced` so that fields from the `owner` source are not included when `hubspot_owner_enabled` is set to false.

## Under the Hood
- Included auto-releaser GitHub Actions workflow to automate future releases.

# dbt_hubspot v0.15.0

[PR #127](https://github.com/fivetran/dbt_hubspot/pull/127) includes the following updates:
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'hubspot'
version: '0.15.0'
version: '0.15.1'

config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'hubspot_integration_tests'
version: '0.15.0'
version: '0.15.1'

profile: 'integration_tests'
config-version: 2
Expand Down
15 changes: 12 additions & 3 deletions models/sales/intermediate/int_hubspot__deals_enhanced.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ with deals as (
select *
from {{ var('deal_pipeline_stage') }}

{% if var('hubspot_owner_enabled', true) %}
), owners as (

select *
from {{ var('owner') }}
{% endif %}

), deal_fields_joined as (

Expand All @@ -30,16 +32,23 @@ with deals as (
coalesce(pipeline_stages.is_deal_pipeline_stage_deleted, false) as is_deal_pipeline_stage_deleted,
pipelines.deal_pipeline_created_at,
pipelines.deal_pipeline_updated_at,
pipeline_stages.pipeline_stage_label,
owners.email_address as owner_email_address,
owners.full_name as owner_full_name
pipeline_stages.pipeline_stage_label

{% if var('hubspot_owner_enabled', true) %}
, owners.email_address as owner_email_address
, owners.full_name as owner_full_name
{% endif %}

from deals
left join pipelines
on deals.deal_pipeline_id = pipelines.deal_pipeline_id
left join pipeline_stages
on deals.deal_pipeline_stage_id = pipeline_stages.deal_pipeline_stage_id

{% if var('hubspot_owner_enabled', true) %}
left join owners
on deals.owner_id = owners.owner_id
{% endif %}
)

select *
Expand Down
Loading