Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:
Updates casting of vid_to_merge as {{ dbt.type_int() }} to {{ dbt.type_string() }}. Casting only to int caused model failures resulting from integer fields that exceeded the range allowed in certain warehouses. In addition, for the case where the contact_merge_audit table is not present, the parsed calculated_merged_vids from the contact table are outputted as strings, therefore requiring the titular datatype cast in the join.
PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
[ ] dbt compile
[ ] dbt run –full-refresh
[x] dbt run
[x] dbt test
[x] dbt run –vars hubspot_contact_merge_audit_enabled: true
Before marking this PR as "ready for review" the following have been applied:
[x] The appropriate issue has been linked and tagged
[x] You are assigned to the corresponding issue and this PR
[x] BuildKite integration tests are passing
Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
[x] You have validated these changes and assure this PR will address the respective Issue/Feature.
[ x] You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
[x] You have provided details below around the validation steps performed to gain confidence in these changes.
Testing where contact_merge_audit exists
I first recreated the issue by changing a value of vid_to_merge in the contact_audit_merge table to something larger than 2147483647, then running. Running against prod, as expected I got a size error (Value out of range for 4 bytes.)
Then in this branch, I updated the cast to use string. The model ran successfully.
Updating to bigint was also successful.
We ultimately ended choosing to cast as string for the added reason where in the case where the contact_merge_audit table is not present, the parsed calculated_merged_vids from the contact table are outputted as strings, therefore requiring the titular datatype cast in the join. Therefore both join keys are going to be cast as strings
Testing for when contact_merge_audit doesn't exist
I set removed hubspot_contact_merge_audit_enabled as the default is false.
Then I ran the compiled code with the customer's shared data and the model succeeds (see screenshots in internal ticket)
Standard Updates
Please acknowledge that your PR contains the following standard updates:
Package versioning has been appropriately indexed in the following locations:
[x] indexed within dbt_project.yml
[x] indexed within integration_tests/dbt_project.yml
[x] CHANGELOG has individual entries for each respective change in this PR
[ ] README updates have been applied (if applicable)
[ ] DECISIONLOG updates have been updated (if applicable)
[ ] Appropriate yml documentation has been added (if applicable)
dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
[ ] docs were regenerated (unless this PR does not include any code or yml updates)
If you had to summarize this PR in an emoji, which would it be?
PR Overview
This PR will address the following Issue/Feature: https://github.com/fivetran/dbt_hubspot/issues/139 This PR will result in the following new package version: v0.17.1
Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:
vid_to_merge
as{{ dbt.type_int() }}
to{{ dbt.type_string() }}
. Casting only toint
caused model failures resulting from integer fields that exceeded the range allowed in certain warehouses. In addition, for the case where thecontact_merge_audit
table is not present, the parsedcalculated_merged_vids
from the contact table are outputted as strings, therefore requiring the titular datatype cast in the join.PR Checklist
Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
Before marking this PR as "ready for review" the following have been applied:
Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
Testing where
contact_merge_audit
existsI first recreated the issue by changing a value of
vid_to_merge
in thecontact_audit_merge
table to something larger than 2147483647, then running. Running against prod, as expected I got a size error (Value out of range for 4 bytes.)Then in this branch, I updated the cast to use string. The model ran successfully.
Updating to bigint was also successful.
We ultimately ended choosing to cast as string for the added reason where in the case where the
contact_merge_audit
table is not present, the parsedcalculated_merged_vids
from the contact table are outputted as strings, therefore requiring the titular datatype cast in the join. Therefore both join keys are going to be cast as stringsTesting for when
contact_merge_audit
doesn't existhubspot_contact_merge_audit_enabled
as the default is false.Standard Updates
Please acknowledge that your PR contains the following standard updates:
dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
If you had to summarize this PR in an emoji, which would it be?
:dancer: