Skip to content

Commit

Permalink
Merge pull request #94 from fivetran/bugfix/uniqueness-test-adjustment
Browse files Browse the repository at this point in the history
bugfix/uniqueness-test-adjustment
  • Loading branch information
fivetran-joemarkiewicz authored Feb 6, 2023
2 parents a218221 + e8c94a4 commit 123b3ef
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 33 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# dbt_hubspot v0.8.2
## Bug Fixes
- Following the release of `v0.8.0`, the end model uniqueness tests were not updated to account for the added flexibility of the inclusion of deleted records. As such the respective end model tests have been adjusted to test uniqueness only on non-deleted records. ([#94](https://github.com/fivetran/dbt_hubspot/pull/94))

## Under the Hood
- Addition of the dbt-expectations package to be used for more robust testing of uniqueness for end models. ([#94](https://github.com/fivetran/dbt_hubspot/pull/94))

# dbt_hubspot v0.8.0

## 🚨 Breaking Changes 🚨:
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
href="https://github.com/fivetran/dbt_hubspot/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
<a alt="dbt-core">
`<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_,<2.0.0-orange.svg" /></a>`
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_,<2.0.0-orange.svg" /></a>
<a alt="Maintained?">
<img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" /></a>
<a alt="PRs">
Expand Down Expand Up @@ -232,6 +232,12 @@ packages:
- package: dbt-labs/spark_utils
version: [">=0.3.0", "<0.4.0"]
- package: calogica/dbt_expectations
version: [">=0.8.0", "<0.9.0"]
- package: calogica/dbt_date
version: [">=0.7.0", "<0.8.0"]
```
# 🙌 How is this package maintained and can I contribute?
## Package Maintenance
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.8.0'
version: '0.8.2'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
vars:
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/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.

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.8.0'
version: '0.8.2'
profile: 'integration_tests'
config-version: 2
vars:
Expand Down
33 changes: 22 additions & 11 deletions models/marketing/email_events/email_events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: returned_response
Expand Down Expand Up @@ -65,7 +66,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: geo_location
Expand Down Expand Up @@ -113,7 +115,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: returned_response
Expand Down Expand Up @@ -149,7 +152,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: returned_response
Expand Down Expand Up @@ -203,7 +207,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: from_email
Expand Down Expand Up @@ -245,7 +250,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: geo_location
Expand Down Expand Up @@ -293,7 +299,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: geo_location
Expand Down Expand Up @@ -338,7 +345,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: geo_location
Expand Down Expand Up @@ -389,7 +397,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: from_email
Expand Down Expand Up @@ -428,7 +437,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: ip_address
Expand Down Expand Up @@ -470,7 +480,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: is_bounced
Expand Down
9 changes: 6 additions & 3 deletions models/marketing/marketing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ models:
- name: event_id
description: The ID of the event.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: from_email
Expand Down Expand Up @@ -218,7 +219,8 @@ models:
- name: contact_id
description: The ID of the contact.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_deleted, false)"
- not_null

- name: contact_company
Expand Down Expand Up @@ -332,7 +334,8 @@ models:
- name: contact_list_id
description: The ID of the contact list.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_contact_list_deleted, false)"
- not_null

- name: contact_list_name
Expand Down
18 changes: 6 additions & 12 deletions models/sales/sales.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ models:
- name: deal_id
description: The ID of the deal
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_deal_deleted, false)"
- unique

- name: deal_name
Expand Down Expand Up @@ -92,7 +93,8 @@ models:
- name: deal_stage_id
description: The unique deal stage identifier.
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_deal_pipeline_stage_deleted, false)"
- unique

- name: is_deal_pipeline_deleted
Expand Down Expand Up @@ -158,22 +160,14 @@ models:
- name: deal_name
description: The name you have given this deal.

- name: is_deal_pipeline_deleted
description: Whether the record was deleted from the deal pipeline table.

- name: is_deal_pipeline_stage_deleted
description: Whether the record was deleted from the deal pipeline stage table.

- name: is_deal_deleted
description: Whether the record was deleted from the deal table.

- name: hubspot__companies
description: Each record represents a company in Hubspot.
columns:
- name: company_id
description: The ID of the company.
tests:
- unique
- dbt_expectations.expect_column_values_to_be_unique:
row_condition: "not coalesce(is_company_deleted, false)"
- not_null

- name: portal_id
Expand Down
2 changes: 2 additions & 0 deletions packages.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
packages:
- package: fivetran/hubspot_source
version: [">=0.8.0", "<0.9.0"]
- package: calogica/dbt_expectations
version: [">=0.8.0", "<0.9.0"]

0 comments on commit 123b3ef

Please sign in to comment.