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
Add parent email to new contact rollups process #34541
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.
Thank you Ben!
@@ -23,25 +23,45 @@ def self.truncate_table | |||
end | |||
|
|||
def self.extract_email_preferences | |||
query = extract_from_source_query('email_preferences', ['opt_in'], 'email') | |||
query = get_extraction_query("#{CDO.dashboard_db_name}.email_preferences", false, ['opt_in'], 'email') |
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.
Non-blocking: what if we change the parameter order by moving source_is_query
to the end (closer to source_name
) and set its default value to false
? This line will be shorter and read more smoothly: get extraction query for <a table> for <several columns>.
query = get_extraction_query("#{CDO.dashboard_db_name}.email_preferences", false, ['opt_in'], 'email') | |
query = get_extraction_query("#{CDO.dashboard_db_name}.email_preferences", 'email', ['opt_in']) |
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.
Fixed, much better!
PLC-815
Extracts
parent_email
from theusers
table and adds it to the contact rollups pipeline. Note that there are no additional attributes associated with the email being extracted here, just the parent's email address itself.Required a little of restructuring to deal with allowing a subquery to be used. Namely, I've added an optional argument for a
source_name
when the data isn't coming from a single dashboard table -- @hacodeorg proposed this should follow the structureschema.table.column_name
.Testing story
Ran
bin/cron/build_contact_rollups_v2
successfully and manually reviewed results in each step of contact rollups process (raw, processed, final). Successful integration test and unit tests for raw and processed steps. Added some new unit testing as well.Reviewer Checklist: