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

Feature/contact list api updates #156

Merged
merged 10 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# dbt_hubspot v0.22.0

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

## Deprecations
- Select fields have been deprecated from `hubspot__contact_lists` model as well as the upstream `stg_hubspot__contact_list` model (see HubSpot Source ([#137](https://github.com/fivetran/dbt_hubspot_source/pull/137)) for details). The full removal date is planned for May 10th, 2025. Follow [Deprecation Issue #138](https://github.com/fivetran/dbt_hubspot_source/issues/138) for more details and updates around the planned sunsetting of the fields.
- The deprecated fields include the following:
- `is_deletable`
- `is_dynamic`
- `metadata_error`
- `metadata_last_processing_state_change_at`
- `metadata_last_size_change_at`
- `metadata_processing`
- `metadata_size`
- `portal_id`

## Breaking Changes
- Select fields have been added to the`hubspot__contact_lists` model as well as the upstream `stg_hubspot__contact_list` model (see HubSpot Source ([#137](https://github.com/fivetran/dbt_hubspot_source/pull/137)) for details).
- The deprecated fields include the following:
- `created_by_id`
- `object_type_id`
- `processing_status`
- `processing_type`
- `list_version`
- `filters_updated_at`

## Documentation
- All deprecated fields have been documented as notice of deprecation in the respective yml documents.
- All added fields have been documented.

## Under the Hood
- Added a deprecation tracker github issue template to ensure deprecated fields are appropriately tracked for full removal in a future planned update.
- Added consistency validation tests to ensure the `hubspot__contact_lists` model remains consistent on subsequent updates.
- Included an integrity validation test to ensure the accuracy of the `hubspot__contact_lists` model.
- Updated the daily ticket integrity and consistency tests to be turned off if the `hubspot_service_enabled` variable is disabled.

# dbt_hubspot v0.21.0
This release includes the following updates:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Include the following hubspot package version in your `packages.yml` file:
```yaml
packages:
- package: fivetran/hubspot
version: [">=0.21.0", "<0.22.0"] # we recommend using ranges to capture non-breaking changes automatically
version: [">=0.22.0", "<0.23.0"] # we recommend using ranges to capture non-breaking changes automatically

```
Do **NOT** include the `hubspot_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.
Expand Down Expand Up @@ -321,7 +321,7 @@ This dbt package is dependent on the following dbt packages. These dependencies
```yml
packages:
- package: fivetran/hubspot_source
version: [">=0.17.0", "<0.18.0"]
version: [">=0.18.0", "<0.19.0"]

- package: fivetran/fivetran_utils
version: [">=0.4.0", "<0.5.0"]
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.21.0'
version: '0.22.0'

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.

47 changes: 37 additions & 10 deletions docs/index.html

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

16 changes: 9 additions & 7 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: '0.21.0'
version: '0.22.0'

profile: 'integration_tests'
config-version: 2
Expand All @@ -10,11 +10,18 @@ models:

vars:
hubspot_schema: hubspot_integration_tests_63
consistency_test_contact_list_exclude_fields: ## For hubspot__contact_lists consistency test. Can be removed after this coming release.
- created_by_id
- object_type_id
- processing_status
- processing_type
- list_version
- filters_updated_at

# hubspot__pass_through_all_columns: true
# hubspot__company_pass_through_columns:
# - name: "property_hs_all-funky-a9384-syntax"
# alias: "funky_field"

# hubspot_service_enabled: true # enable when generating docs
# hubspot_deal_enabled: true # enable when generating docs
# hubspot_contact_enabled: true # enable when generating docs
Expand Down Expand Up @@ -200,11 +207,6 @@ seeds:
+enabled: "{{ true if target.type == 'postgres' else false }}"
email_event_dropped_data:
+enabled: "{{ true if target.type not in ('snowflake', 'postgres') else false }}"
contact_list_data:
+enabled: "{{ true if target.type != 'postgres' else false }}"
contact_list_data_postgres:
+alias: contact_list_data
+enabled: "{{ true if target.type == 'postgres' else false }}"
email_event_data:
+column_types:
_fivetran_synced: timestamp
Expand Down
122 changes: 61 additions & 61 deletions integration_tests/seeds/contact_list_data.csv

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions integration_tests/seeds/contact_list_data_postgres.csv

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false) and var('hubspot_contact_list_enabled', true)
) }}

-- this test ensures the contact_list end model matches the prior version
with prod as (
select
{{ dbt_utils.star(
from=ref('hubspot__contact_lists'),
except=var('consistency_test_contact_list_exclude_fields', []))
}}
from {{ target.schema }}_hubspot_prod.hubspot__contact_lists
),

dev as (
select
{{ dbt_utils.star(
from=ref('hubspot__contact_lists'),
except=var('consistency_test_contact_list_exclude_fields', []))
}}
from {{ target.schema }}_hubspot_dev.hubspot__contact_lists
),

prod_not_in_dev as (
-- rows from prod not found in dev
select * from prod
except distinct
select * from dev
),

dev_not_in_prod as (
-- rows from dev not found in prod
select * from dev
except distinct
select * from prod
),

final as (
select
*,
'from prod' as source
from prod_not_in_dev

union all -- union since we only care if rows are produced

select
*,
'from dev' as source
from dev_not_in_prod
)

select *
from final
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
enabled=var('fivetran_validation_tests_enabled', false) and var('hubspot_service_enabled', false)
) }}

-- this test ensures the daily_activity end model matches the prior version
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false) and var('hubspot_contact_list_enabled', true)
) }}

-- this test is to make sure the rows counts are the same between versions
with prod as (
select count(*) as prod_rows
from {{ target.schema }}_hubspot_prod.hubspot__contact_lists
),

dev as (
select count(*) as dev_rows
from {{ target.schema }}_hubspot_dev.hubspot__contact_lists
)

-- test will return values and fail if the row counts don't match
select *
from prod
cross join dev
where prod.prod_rows != dev.dev_rows
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
enabled=var('fivetran_validation_tests_enabled', false) and var('hubspot_service_enabled', false)
) }}

-- this test is to make sure the rows counts are the same between versions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false) and var('hubspot_contact_list_enabled', true)
) }}

-- This test will ensure the total count of records from the contact_list staging model matches the end model.
with end_model as (
select count(*) as end_model_rows
from {{ ref('hubspot__contact_lists') }}
),

staging_model as (
select count(*) as staging_model_rows
from {{ ref('stg_hubspot__contact_list') }}
)

select *
from end_model
cross join staging_model
where end_model_rows != staging_model_rows
Loading