Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit ac7706b

Browse files
Merge pull request #122 from fivetran/release/v0.14.0
Release/v0.14.0
2 parents c3e8171 + 50cbe39 commit ac7706b

25 files changed

+395
-25
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# dbt_hubspot_source v0.14.0
2+
[PR #122](https://github.com/fivetran/dbt_hubspot_source/pull/122) includes the following updates:
3+
4+
## Features
5+
- Added the following staging models, along with documentation and tests:
6+
- `stg_hubspot__property`
7+
- `stg_hubspot__property_option`
8+
- These tables can be disabled by setting `hubspot_property_enabled: False` in your dbt_project.yml vars. See [Step 4 of the README](https://github.com/fivetran/dbt_hubspot_source#step-4-disable-models-for-non-existent-sources) for more details.
9+
10+
- When including a passthrough `property_hs_*` column, you now have the option to include the corresponding, human-readable label in the staging models.
11+
- The above-mentioned `property` tables are required for this feature. If you do not have them and have to disable them, unfortunately you will not be able to use this feature.
12+
- See the [Adding property label section](https://github.com/fivetran/dbt_hubspot_source#adding-property-label) of the README for instructions on how to enable this feature!
13+
- We recommend being selective with the label columns you add. As you add more label columns, your run time will increase due to the underlying logic requirements.
14+
- This update applies to models:
15+
- `stg_hubspot__company`
16+
- `stg_hubspot__contact`
17+
- `stg_hubspot__deal`
18+
- `stg_hubspot__ticket`
19+
20+
## Bug fixes
21+
- Updated macro `remove_duplicate_and_prefix_from_columns` to accommodate incoming custom column names containing characters such as `-` or `$` that are not permitted. The resulting column name will have these characters removed or replaced in its `stg_*` model.
22+
- Removed extra comma from `stg_hubspot__ticket`, which was causing compilation issues when passing through all columns.
23+
124
# dbt_hubspot_source v0.13.0
225

326
## 🚨 Breaking Changes 🚨

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Include the following hubspot_source package version in your `packages.yml` file
4444
```yaml
4545
packages:
4646
- package: fivetran/hubspot_source
47-
version: [">=0.13.0", "<0.14.0"]
47+
version: [">=0.14.0", "<0.15.0"]
4848
```
4949
## Step 3: Define database and schema variables
5050
By default, this package runs using your destination and the `hubspot` schema. If this is not where your HubSpot data is (for example, if your HubSpot schema is named `hubspot_fivetran`), add the following configuration to your root `dbt_project.yml` file:
@@ -104,6 +104,7 @@ vars:
104104
hubspot_engagement_note_enabled: false
105105
hubspot_engagement_task_enabled: false
106106
hubspot_owner_enabled: false
107+
hubspot_property_enabled: false # Disables property and property_option tables
107108
108109
# Service
109110
hubspot_service_enabled: true # Enables all service models
@@ -135,7 +136,7 @@ vars:
135136
hubspot__ticket_pass_through_columns:
136137
- name: "property_mmm"
137138
alias: "mmm"
138-
- name: "property_bop"
139+
- name: "property_hs_bop"
139140
alias: "bop"
140141
```
141142
**Alternatively**, if you would like to simply pass through **all columns** in the above four tables, add the following configuration to your dbt_project.yml. Note that this will override any `hubspot__[table_name]_pass_through_columns` variables.
@@ -144,6 +145,34 @@ vars:
144145
vars:
145146
hubspot__pass_through_all_columns: true # default is false
146147
```
148+
149+
### Adding property label
150+
For `property_hs_*` columns, you can enable the corresponding, human-readable `property_option`.`label` to be included in the staging models.
151+
152+
#### Important!
153+
- You must have sources `property` and `property_option` enabled to enable labels. By default, these sources are enabled.
154+
- You CANNOT enable labels if using `hubspot__pass_through_all_columns: true`.`
155+
- We recommend being selective with the label columns you add. As you add more label columns, your run time will increase due to the underlying logic requirements.
156+
157+
To enable labels for a given property, set the property attribute `add_property_label: true`, using the below format.
158+
159+
```yml
160+
vars:
161+
hubspot__ticket_pass_through_columns:
162+
- name: "property_hs_fieldname"
163+
alias: "fieldname"
164+
add_property_label: true
165+
```
166+
167+
Alternatively, you can enable labels for all passthrough properties by using variable `hubspot__enable_all_property_labels: true`, formatted like the below example.
168+
169+
```yml
170+
vars:
171+
hubspot__enable_all_property_labels: true # cannot use in conjunction with `hubspot__pass_through_all_columns: true`
172+
hubspot__ticket_pass_through_columns:
173+
- name: "property_hs_fieldname1"
174+
- name: "property_hs_fieldname2"
175+
```
147176
### Including calculated fields
148177
This package also provides the ability to pass calculated fields through to the `company`, `contact`, `deal`, and `ticket` staging models. If you would like to add a calculated field to any of the mentioned staging models, you may configure the respective `hubspot__[table_name]_calculated_fields` variables with the `name` of the field you would like to create, and the `transform_sql` which will be the actual calculation that will make up the calculated field.
149178
```yml

dbt_project.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'hubspot_source'
2-
version: '0.13.0'
2+
version: '0.14.0'
33
config-version: 2
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55
models:
@@ -47,6 +47,8 @@ vars:
4747
engagement_note: "{{ source('hubspot','engagement_note') }}"
4848
engagement_task: "{{ source('hubspot','engagement_task') }}"
4949
owner: "{{ source('hubspot','owner') }}"
50+
property: "{{ source('hubspot','property') }}"
51+
property_option: "{{ source('hubspot','property_option') }}"
5052
ticket_company: "{{ source('hubspot','ticket_company') }}"
5153
ticket_contact: "{{ source('hubspot','ticket_contact') }}"
5254
ticket_deal: "{{ source('hubspot','ticket_deal') }}"

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/run_results.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

integration_tests/ci/sample.profiles.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ integration_tests:
1616
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
1717
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
1818
port: 5439
19-
schema: hubspot_source_integration_tests_7
19+
schema: hubspot_source_integration_tests_999
2020
threads: 8
2121
bigquery:
2222
type: bigquery
2323
method: service-account-json
2424
project: 'dbt-package-testing'
25-
schema: hubspot_source_integration_tests_7
25+
schema: hubspot_source_integration_tests_999
2626
threads: 8
2727
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
2828
snowflake:
@@ -33,7 +33,7 @@ integration_tests:
3333
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
3434
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
3535
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
36-
schema: hubspot_source_integration_tests_7
36+
schema: hubspot_source_integration_tests_999
3737
threads: 8
3838
postgres:
3939
type: postgres
@@ -42,13 +42,13 @@ integration_tests:
4242
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
4343
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
4444
port: 5432
45-
schema: hubspot_source_integration_tests_7
45+
schema: hubspot_source_integration_tests_999
4646
threads: 8
4747
databricks:
4848
catalog: null
4949
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
5050
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
51-
schema: hubspot_source_integration_tests_7
51+
schema: hubspot_source_integration_tests_999
5252
threads: 8
5353
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
5454
type: databricks

integration_tests/dbt_project.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
name: 'hubspot_source_integration_tests'
2-
version: '0.13.0'
2+
version: '0.14.0'
33
profile: 'integration_tests'
44
config-version: 2
55
models:
66
hubspot_source:
77
+schema:
88
vars:
9-
hubspot_schema: hubspot_source_integration_tests_7
9+
hubspot_schema: hubspot_source_integration_tests_999
1010
hubspot_source:
1111
hubspot_service_enabled: true
12+
# hubspot_sales_enabled: true # enable when generating docs
13+
# hubspot_marketing_enabled: true # enable when generating docs
14+
# hubspot_contact_merge_audit_enabled: true # enable when generating docs
15+
# hubspot_using_all_email_events: true # enable when generating docs
1216
hubspot_company_property_history_identifier: "company_property_history_data"
1317
hubspot_company_identifier: "company_data"
1418
hubspot_contact_identifier: "contact_data"
@@ -43,6 +47,8 @@ vars:
4347
hubspot_engagement_note_identifier: "engagement_note_data"
4448
hubspot_engagement_task_identifier: "engagement_task_data"
4549
hubspot_owner_identifier: "owner_data"
50+
hubspot_property_identifier: "property_data"
51+
hubspot_property_option_identifier: "property_option_data"
4652
hubspot_ticket_company_identifier: "ticket_company_data"
4753
hubspot_ticket_contact_identifier: "ticket_contact_data"
4854
hubspot_ticket_deal_identifier: "ticket_deal_data"

integration_tests/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ dbt-redshift>=1.3.0,<2.0.0
44
dbt-postgres>=1.3.0,<2.0.0
55
dbt-spark>=1.3.0,<2.0.0
66
dbt-spark[PyHive]>=1.3.0,<2.0.0
7-
dbt-databricks>=1.3.0,<2.0.0
8-
oscrypto @ git+https://github.com/wbond/oscrypto.git@d5f3437
7+
dbt-databricks>=1.3.0,<2.0.0
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
_fivetran_id,_fivetran_synced,calculated,created_at,description,field_type,group_name,hubspot_defined,hubspot_object,label,name,show_currency_symbol,type,updated_at
2+
+mlGrLvmij8zluyeRByh7DPbXpM=,2023-11-11 08:18:16.519000 UTC,false,2023-05-03 08:51:08.199000 UTC,M0xKTEL9t51+vD5ztRfm+A==,date,fVQYOcf70/KsHU/KFoXQfQ==,,contact,test_pro,test_pro,false,date,2023-05-03 08:51:08.199000 UTC
3+
6fnvV+pkZR3di3USRclW2NZMNTA=,2023-11-11 08:18:15.151000 UTC,false,2019-08-06 02:41:52.364000 UTC,k+VMRhjE/W4QB470Jor1yA==,date,j8mgV9/MYzXvxQKD3c0AHw==,true,deal,Close Date,closedate,,datetime,2023-06-20 22:32:28.368000 UTC
4+
5yTEFwFlLPTKlzXc3PviX5DMdJ4=,2023-11-11 08:18:16.569000 UTC,false,2019-08-06 02:41:09.071000 UTC,nRGOJjIZrs4d0WJLkC15fg==,date,fVQYOcf70/KsHU/KFoXQfQ==,true,contact,Close Date,closedate,,datetime,2022-05-27 20:35:26.640000 UTC
5+
u0bk1tHdJJir2SmRkwo1r22t2PM=,2023-11-11 08:18:15.837000 UTC,false,2019-08-06 02:41:44.665000 UTC,HRIf2XFKVmDQxMzI2w3mcA==,date,XArNQdwSO+DY7119vj+JEw==,true,company,Close Date,closedate,,datetime,2022-05-27 22:49:16.893000 UTC
6+
RTJ5KTwQe/zMYl8uKwNFlOeNWUY=,2023-11-11 08:18:15.792000 UTC,false,2022-11-30 10:52:48.277000 UTC,1B2M2Y8AsgTpgAmY7PhCfg==,date,XArNQdwSO+DY7119vj+JEw==,,company,test_date,test_date,false,date,2022-11-30 10:52:48.277000 UTC
7+
sv5Aa2A1+wJwoKRX4Zfe3CTEHEE=,2023-11-11 08:18:16.575000 UTC,false,2019-08-06 02:41:09.148000 UTC,jjSyQlM9DMhpVol12tp4fg==,date,fVQYOcf70/KsHU/KFoXQfQ==,true,contact,Create Date,createdate,,datetime,2023-05-01 20:02:33.973000 UTC
8+
GjTSotYsbt+HoRY5e6bHRgNJYFI=,2023-11-11 08:18:36.368000 UTC,false,2019-08-06 02:42:48.261000 UTC,nBljQWslMNrEDwXeYmRYyg==,date,0NoL94xOqMRlkFF+GAX6QQ==,true,product,Create Date,createdate,,datetime,2022-05-28 01:26:21.260000 UTC
9+
6iFNLSeY0Fz5DgwskGjrMoW3JIg=,2023-11-11 08:18:13.861000 UTC,false,2019-08-06 02:42:38.781000 UTC,lMRanmvFHjNC0pQdw79H5Q==,date,kdJdJeqzIqBPlKTSRZoyGQ==,true,line_item,Create Date,createdate,,datetime,2022-05-28 01:31:47.067000 UTC
10+
onbRYvHwxXS3NwSP2zaoD+Mv/us=,2023-11-11 08:18:36.567000 UTC,false,2019-08-06 02:43:00.503000 UTC,MD3INB3ab4k2LqaTom0eEA==,date,CfZkcOOMcc/dg5a9ofwkUg==,true,ticket,Create date,createdate,,datetime,2022-08-18 12:55:35.731000 UTC
11+
XhKQ/eq5pqJEB6smEKCPSSyfUH4=,2023-11-11 08:18:15.836000 UTC,false,2019-08-06 02:41:44.631000 UTC,wyvwVnWdqsdNRapzG8Y/RA==,date,XArNQdwSO+DY7119vj+JEw==,true,company,Create Date,createdate,,datetime,2023-05-01 19:33:57.873000 UTC

0 commit comments

Comments
 (0)