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

Commit 95ab87d

Browse files
feature/freshness-updates (#144)
* feature/freshness-updates * pr ref fix
1 parent 28acd88 commit 95ab87d

File tree

10 files changed

+55
-25
lines changed

10 files changed

+55
-25
lines changed

.buildkite/pipeline.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ steps:
33
key: "run-dbt-postgres"
44
plugins:
55
- docker#v3.13.0:
6-
image: "python:3.8"
6+
image: "python:3.10.13"
77
shell: [ "/bin/bash", "-e", "-c" ]
88
environment:
99
- "BASH_ENV=/tmp/.bashrc"
@@ -18,7 +18,7 @@ steps:
1818
key: "run_dbt_snowflake"
1919
plugins:
2020
- docker#v3.13.0:
21-
image: "python:3.8"
21+
image: "python:3.10.13"
2222
shell: [ "/bin/bash", "-e", "-c" ]
2323
environment:
2424
- "BASH_ENV=/tmp/.bashrc"
@@ -35,7 +35,7 @@ steps:
3535
key: "run_dbt_bigquery"
3636
plugins:
3737
- docker#v3.13.0:
38-
image: "python:3.8"
38+
image: "python:3.10.13"
3939
shell: [ "/bin/bash", "-e", "-c" ]
4040
environment:
4141
- "BASH_ENV=/tmp/.bashrc"
@@ -47,7 +47,7 @@ steps:
4747
key: "run_dbt_redshift"
4848
plugins:
4949
- docker#v3.13.0:
50-
image: "python:3.8"
50+
image: "python:3.10.13"
5151
shell: [ "/bin/bash", "-e", "-c" ]
5252
environment:
5353
- "BASH_ENV=/tmp/.bashrc"
@@ -62,7 +62,7 @@ steps:
6262
key: "run_dbt_databricks"
6363
plugins:
6464
- docker#v3.13.0:
65-
image: "python:3.8"
65+
image: "python:3.10.13"
6666
shell: [ "/bin/bash", "-e", "-c" ]
6767
environment:
6868
- "BASH_ENV=/tmp/.bashrc"
@@ -77,7 +77,7 @@ steps:
7777
key: "run_dbt_databricks_sql"
7878
plugins:
7979
- docker#v3.13.0:
80-
image: "python:3.8"
80+
image: "python:3.10.13"
8181
shell: [ "/bin/bash", "-e", "-c" ]
8282
environment:
8383
- "BASH_ENV=/tmp/.bashrc"

.buildkite/scripts/run_models.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ cd integration_tests
1818
dbt deps
1919
if [ "$db" = "databricks-sql" ]; then
2020
dbt seed --vars '{hubspot_schema: hubspot_sqlw_tests_8}' --target "$db" --full-refresh
21+
dbt source freshness --vars '{hubspot_schema: hubspot_sqlw_tests_8}' --target "$db" || echo "...Only verifying freshness runs..."
2122
dbt compile --vars '{hubspot_schema: hubspot_sqlw_tests_8}' --target "$db"
2223
dbt run --vars '{hubspot_schema: hubspot_sqlw_tests_8}' --target "$db" --full-refresh
2324
dbt test --vars '{hubspot_schema: hubspot_sqlw_tests_8}' --target "$db"
@@ -26,6 +27,7 @@ dbt run --vars '{hubspot_schema: hubspot_sqlw_tests_8, hubspot_marketing_enabled
2627
dbt test --vars '{hubspot_schema: hubspot_sqlw_tests_8}' --target "$db"
2728
else
2829
dbt seed --target "$db" --full-refresh
30+
dbt source freshness --target "$db" || echo "...Only verifying freshness runs..."
2931
dbt run --target "$db" --full-refresh
3032
dbt test --target "$db"
3133
dbt run --vars '{hubspot_marketing_enabled: true, hubspot_sales_enabled: false}' --target "$db"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ target/
33
dbt_modules/
44
logs/
55
.DS_Store
6-
dbt_packages/
6+
dbt_packages/
7+
env/

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# dbt_hubspot_source v0.20.0
2+
3+
[PR #144](https://github.com/fivetran/dbt_hubspot_source/pull/144) includes the following updates:
4+
5+
## Breaking Change for dbt Core < 1.9.6
6+
7+
> *Note: This is not relevant to Fivetran Quickstart users.*
8+
9+
Migrated `freshness` from a top-level source property to a source `config` in alignment with [recent updates](https://github.com/dbt-labs/dbt-core/issues/11506) from dbt Core. This will resolve the following deprecation warning that users running dbt >= 1.9.6 may have received:
10+
11+
```
12+
[WARNING]: Deprecated functionality
13+
Found `freshness` as a top-level property of `hubspot` in file
14+
`models/src_hubspot.yml`. The `freshness` top-level property should be moved
15+
into the `config` of `hubspot`.
16+
```
17+
18+
**IMPORTANT:** Users running dbt Core < 1.9.6 will not be able to utilize freshness tests in this release or any subsequent releases, as older versions of dbt will not recognize freshness as a source `config` and therefore not run the tests.
19+
20+
If you are using dbt Core < 1.9.6 and want to continue running HubSpot freshness tests, please elect **one** of the following options:
21+
1. (Recommended) Upgrade to dbt Core >= 1.9.6
22+
2. Do not upgrade your installed version of the `hubspot_source` package. Pin your dependency on v0.19.0 in your `packages.yml` file.
23+
3. Utilize a dbt [override](https://docs.getdbt.com/reference/resource-properties/overrides) to overwrite the package's `hubspot` source and apply freshness via the previous release top-level property route. This will require you to copy and paste the entirety of the previous release `src_hubspot.yml` file and add an `overrides: hubspot_source` property.
24+
25+
## Under the Hood
26+
- Updates to ensure integration tests use latest version of dbt.
27+
128
# dbt_hubspot_source v0.19.0
229
[PR #142](https://github.com/fivetran/dbt_hubspot_source/pull/142) includes the following updates:
330

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<!--section="hubspot_source_model"-->
1919
- Materializes [HubSpot staging tables](https://fivetran.github.io/dbt_hubspot_source/#!/overview/hubspot_source/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/hubspot#schemainformation). These staging tables clean, test, and prepare your HubSpot data from [Fivetran's connector](https://fivetran.com/docs/applications/hubspot) for analysis by doing the following:
2020
- Name columns for consistency across all packages and for easier analysis
21-
- Adds freshness tests to source data
21+
- Adds freshness tests to source data. dbt Core >= 1.9.6 is required to run freshness tests out of the box.
2222
- Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values.
2323
- Generates a comprehensive data dictionary of your HubSpot data through the [dbt docs site](https://fivetran.github.io/dbt_hubspot_source/).
2424
- These tables are designed to work simultaneously with our [HubSpot transformation package](https://github.com/fivetran/dbt_hubspot).

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'hubspot_source'
2-
version: '0.19.0'
2+
version: '0.20.0'
33
config-version: 2
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55
models:

integration_tests/ci/sample.profiles.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
# HEY! This file is used in the dbt package integrations tests with Buildkite.
33
# You should __NEVER__ check credentials into version control. Thanks for reading :)
44

5-
config:
6-
send_anonymous_usage_stats: False
7-
use_colors: True
8-
95
integration_tests:
106
target: redshift
117
outputs:

integration_tests/dbt_project.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'hubspot_source_integration_tests'
2-
version: '0.19.0'
2+
version: '0.20.0'
33
profile: 'integration_tests'
44
config-version: 2
55

@@ -250,4 +250,7 @@ seeds:
250250

251251
dispatch:
252252
- macro_namespace: dbt_utils
253-
search_order: ['spark_utils', 'dbt_utils']
253+
search_order: ['spark_utils', 'dbt_utils']
254+
255+
flags:
256+
send_anonymous_usage_stats: False

integration_tests/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ 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
7+
dbt-databricks>=1.3.0,<2.0.0
8+
certifi==2025.1.31

models/src_hubspot.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ sources:
150150

151151
- name: contact
152152
identifier: "{{ var('hubspot_contact_identifier', 'contact')}}"
153-
freshness:
154-
warn_after: {count: 84, period: hour}
155-
error_after: {count: 168, period: hour}
156153
description: Each record represents a contact in Hubspot.
157154
config:
158155
enabled: "{{ var('hubspot_marketing_enabled', true) and var('hubspot_contact_enabled', true) }}"
156+
freshness:
157+
warn_after: {count: 84, period: hour}
158+
error_after: {count: 168, period: hour}
159159
columns:
160160
- name: _fivetran_deleted
161161
description: '{{ doc("_fivetran_deleted") }}'
@@ -301,12 +301,12 @@ sources:
301301

302302
- name: contact_property_history
303303
identifier: "{{ var('hubspot_contact_property_history_identifier', 'contact_property_history')}}"
304-
freshness:
305-
warn_after: {count: 84, period: hour}
306-
error_after: {count: 168, period: hour}
307304
description: Each record represents a change to contact record in Hubspot.
308305
config:
309306
enabled: "{{ var('hubspot_marketing_enabled', true) and var('hubspot_contact_property_enabled', true) and var('hubspot_contact_property_history_enabled', true) }}"
307+
freshness:
308+
warn_after: {count: 84, period: hour}
309+
error_after: {count: 168, period: hour}
310310
columns:
311311
- name: _fivetran_synced
312312
description: '{{ doc("_fivetran_synced") }}'
@@ -515,12 +515,12 @@ sources:
515515

516516
- name: email_event
517517
identifier: "{{ var('hubspot_email_event_identifier', 'email_event')}}"
518-
freshness:
519-
warn_after: {count: 84, period: hour}
520-
error_after: {count: 168, period: hour}
521518
description: Each record represents an email event in Hubspot.
522519
config:
523520
enabled: "{{ var('hubspot_marketing_enabled', true) and var('hubspot_email_event_enabled', true) }}"
521+
freshness:
522+
warn_after: {count: 84, period: hour}
523+
error_after: {count: 168, period: hour}
524524
columns:
525525
- name: _fivetran_synced
526526
description: '{{ doc("_fivetran_synced") }}'

0 commit comments

Comments
 (0)