Skip to content
Open
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
10 changes: 10 additions & 0 deletions .github/workflows/check-docs-current.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Check docs current

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
check-docs:
uses: fivetran/dbt_package_automations/.github/workflows/check-docs-current.yml@docs-generator-status-report
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
generate-docs:
if: github.event.label.name == 'docs:ready'
uses: fivetran/dbt_package_automations/.github/workflows/generate-docs.yml@main
uses: fivetran/dbt_package_automations/.github/workflows/generate-docs.yml@docs-generator-status-report
secrets: inherit
with:
schema_var_name: hubspot_schema
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# dbt_hubspot v1.8.1

[PR #211](https://github.com/fivetran/dbt_hubspot/pull/211) includes the following updates:

## Feature Updates
- Adds DuckDB as a supported destination.


# dbt_hubspot v1.8.0

[PR #201](https://github.com/fivetran/dbt_hubspot/pull/201) includes the following updates:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ By default, this package materializes the following final tables:
To use this dbt package, you must have the following:

- At least one Fivetran HubSpot connection syncing data into your destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, or **Databricks** destination.
- A **BigQuery**, **Snowflake**, **Redshift**, **PostgreSQL**, **Databricks**, or **DuckDB** destination.

## How do I use the dbt package?
You can either add this dbt package in the Fivetran dashboard or import it into your dbt project:
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: '1.8.0'
version: '1.8.1'

config-version: 2
require-dbt-version: [">=1.3.0", "<3.0.0"]
Expand Down
1 change: 1 addition & 0 deletions integration_tests/ci/test_scenarios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ schema_variable_name: "hubspot_schema"

include_databricks_sql: true
include_sqlserver: false
include_duckdb: true
include_dbt_compile: true

test_scenarios:
Expand Down
6 changes: 3 additions & 3 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'hubspot_integration_tests'
version: '1.8.0'
version: '1.8.1'

profile: 'integration_tests'
config-version: 2
Expand Down Expand Up @@ -98,7 +98,7 @@ seeds:
+docs:
show: False
hubspot_integration_tests:
+quote_columns: "{{ target.type == 'redshift' or var('fivetran_using_source_casing', false) }}"
+quote_columns: "{{ target.type in ('redshift', 'duckdb') or var('fivetran_using_source_casing', false) }}"
contact_merge_audit_data:
+column_types:
vid_to_merge: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
Expand Down Expand Up @@ -284,4 +284,4 @@ dispatch:

flags:
send_anonymous_usage_stats: False
use_colors: True
use_colors: True
3 changes: 2 additions & 1 deletion integration_tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ dbt-postgres>=1.3.0,<2.0.0
dbt-spark>=1.3.0,<2.0.0
dbt-spark[PyHive]>=1.3.0,<2.0.0
dbt-databricks>=1.3.0,<2.0.0
certifi==2025.1.31
dbt-duckdb>=1.3.0,<2.0.0
certifi==2025.1.31
12 changes: 12 additions & 0 deletions macros/merge_contacts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@
lateral view explode(split(merged_object_ids, ';')) merges_view as merges

{% endmacro %}

{% macro duckdb__merge_contacts() %}
select
contacts.source_relation,
contacts.contact_id,
merges as vid_to_merge

from contacts
cross join
unnest(string_split(merged_object_ids, ';')) as t(merges)

{% endmacro %}
2 changes: 1 addition & 1 deletion models/service/hubspot__daily_ticket_history.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
enabled=var('hubspot_service_enabled', False),
materialized='incremental' if hubspot.is_incremental_compatible() else 'table',
partition_by = {'field': 'date_day', 'data_type': 'date'}
if target.type not in ['spark', 'databricks'] else ['date_day'],
if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],
unique_key='ticket_day_id',
incremental_strategy = 'insert_overwrite' if target.type not in ('snowflake', 'postgres', 'redshift') else 'delete+insert',
file_format = 'delta'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
enabled=var('hubspot_service_enabled', False),
materialized='incremental' if hubspot.is_incremental_compatible() else 'table',
partition_by = {'field': 'date_day', 'data_type': 'date'}
if target.type not in ['spark', 'databricks'] else ['date_day'],
if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],
unique_key='id',
incremental_strategy='insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',
file_format='delta'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
enabled=var('hubspot_service_enabled', False),
materialized='incremental' if hubspot.is_incremental_compatible() else 'table',
partition_by = {'field': 'date_day', 'data_type': 'date'}
if target.type not in ['spark', 'databricks'] else ['date_day'],
if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],
unique_key='id',
incremental_strategy = 'insert_overwrite' if target.type not in ('snowflake', 'postgres', 'redshift') else 'delete+insert',
file_format = 'delta'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
enabled=var('hubspot_service_enabled', False),
materialized='incremental' if hubspot.is_incremental_compatible() else 'table',
partition_by = {'field': 'date_day', 'data_type': 'date'}
if target.type not in ['spark', 'databricks'] else ['date_day'],
if target.type not in ('spark', 'databricks', 'duckdb') else ['date_day'],
unique_key='id',
incremental_strategy = 'insert_overwrite' if target.type not in ('snowflake', 'postgres', 'redshift') else 'delete+insert',
file_format = 'delta'
Expand Down