adds the new property_hs_calculated_merged_vids field to the contact table seed data
adds logic using the property_hs_calculated_merged_vids source field to merge contacts.
By default, bigquery targets will use the old contact_merge_audit table, but they can turn that off by setting hubspot_contact_merge_audit_enabled to false (the default value of this variable is target.type == 'bigquery')
the new logic is quite complicated!!! we have to turn calculated_merged_vids into an array, and then split it out into rows, and then split it again along a : (the format of this field is vid_to_merge:long_number_that_looks_like_epoch_seconds;second_vid_to_merge;another_epoch_time_maybe;...)
less important: updated the references to target.name to target.type and fixed some wonky seed files
here's a breakdown of the logic/expected output:
let's say in the contact table we have 3 records, and their contact_ids are 100, 200, and 300
when we look at property_hs_calculated_merged_vids, it stores the contact ids that should be merged into the main contact_id. the format is vid_to_be_merged:long_number_that_looks_like_epoch_seconds;second_vid_to_merge;another_epoch_time_maybe;...
let's say contact 100 has a property_hs_calculated_merged_vids value of 200:1654364535;300:165404030. this means that contacts 200 and 300 were merged into 100, so only100 should persist in the final hubspot__contacts model
Did you update the CHANGELOG?
[x] Yes
Does this PR introduce a breaking change?
[x] Yes (please provide breaking change details below.)
[ ] No (please provide an explanation as to how the change is non-breaking below.)
default behavior is different for most users (though they should end up with the same result...so maybe not?)
Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)
[x] Yes
Is this PR in response to a previously created Bug or Feature Request
[x] Local (please provide additional testing details below)
Select which warehouse(s) were used to test the PR
[x] BigQuery
[x] Redshift
[x] Snowflake
[x] Postgres
[x] Databricks
[ ] Other (provide details below)
Provide an emoji that best describes your current mood
🧛
**Feedback**
We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next.
Are you a current Fivetran customer?
internal
What change(s) does this PR introduce?
aligns with recent changes to the hubspot API
property_hs_calculated_merged_vids
field to the contact table seed dataproperty_hs_calculated_merged_vids
source field to merge contacts.hubspot_contact_merge_audit_enabled
to false (the default value of this variable istarget.type == 'bigquery'
)calculated_merged_vids
into an array, and then split it out into rows, and then split it again along a:
(the format of this field isvid_to_merge:long_number_that_looks_like_epoch_seconds;second_vid_to_merge;another_epoch_time_maybe;...
)target.name
totarget.type
and fixed some wonky seed filesi heavily leveraged our iterable code https://github.com/fivetran/dbt_iterable/blob/main/models/intermediate/int_iterable__list_user_unnest.sql
here's a breakdown of the logic/expected output: let's say in the
contact
table we have 3 records, and their contact_ids are100
,200
, and300
when we look at
property_hs_calculated_merged_vids
, it stores the contact ids that should be merged into the maincontact_id
. the format isvid_to_be_merged:long_number_that_looks_like_epoch_seconds;second_vid_to_merge;another_epoch_time_maybe;...
let's say contact
100
has aproperty_hs_calculated_merged_vids
value of200:1654364535;300:165404030
. this means that contacts200
and300
were merged into100
, so only100
should persist in the finalhubspot__contacts
modelDid you update the CHANGELOG?
Does this PR introduce a breaking change?
default behavior is different for most users (though they should end up with the same result...so maybe not?)
Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)
Is this PR in response to a previously created Bug or Feature Request
How did you test the PR changes?
Select which warehouse(s) were used to test the PR
Provide an emoji that best describes your current mood
🧛 **Feedback** We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next.