-
Notifications
You must be signed in to change notification settings - Fork 39
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
Update/crm api v3 - contact_merge_audit table removed #100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-jamie thanks for working through this complicated update. I reviewed the output of the code and it all looks good across warehouses! It does exactly what I would expect 😄. This will be a great update for those encountering the API update woes.
That being said, I would like to clean up the logic a bit. I tried to convert the unnest into a macro and was having luck (with all but redshift). Additionally I had success with converting the split_part logic to just use dbt.split_part (for all but redshift). Therefore, my ask is if we can adjust the code to leverage the split_part macro where possible and make a custom macro for this package (maybe we can dip into fivetran_utils) for the flatten piece. Redshift can still be on it's own, but I would like to dry this code up a bit more if we can.
See my other comments below for additional requests to update. Thanks again!
models/marketing/intermediate/int_hubspot__contact_merge_adjust.sql
Outdated
Show resolved
Hide resolved
models/marketing/intermediate/int_hubspot__contact_merge_adjust.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-jamie we are so close! I just have one final comment around the hubspot_contact_merge_audit_enabled
variable and if we should possibly change it. We can discuss more during standup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fivetran-jamie this looks good to go once the source package is approved!
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 on our existing dbt packages or what you'd like to see next.