Change intermediate ephemeral models to macros, fix failing test - #33
Open
LewisDavies wants to merge 4 commits into
Open
Change intermediate ephemeral models to macros, fix failing test#33LewisDavies wants to merge 4 commits into
LewisDavies wants to merge 4 commits into
Conversation
LewisDavies
commented
Nov 17, 2022
| sum(case when action_type = 'open' then 1 end) as opens, | ||
| sum(case when action_type = 'click' then 1 end) as clicks, | ||
| count(distinct case when action_type = 'open' then segment_id end) as unique_opens, | ||
| count(distinct case when action_type = 'click' then segment_id end) as unique_clicks |
Author
There was a problem hiding this comment.
Note that this model was previously counting the distinct segment_ids, whereas the other models were counting member_ids. The new macro fixes this.
LewisDavies
commented
Nov 17, 2022
| ), unsubscribes_xf as ( | ||
|
|
||
| select | ||
| campaign_id as automation_email_id, |
Author
There was a problem hiding this comment.
The new macro will use automation_email_id instead of campaign_id here. I changed this because it seems like a bug, but happy to be corrected if not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Are you a current Fivetran customer?
Lewis Davies, Senior Analytics Engineer, Prisma
What change(s) does this PR introduce?
Addresses #32
mailchimp__memberswhen automations are enabledlist_idin addition tomember_idint_mailchimp__automation_activities_by_*->agg_automation_activitiesint_mailchimp__campaign_activities_by_*->agg_campaign_activitiesDid you update the CHANGELOG?
Does this PR introduce a breaking change?
All models will run just as before so I classed it as non-breaking. However, the results in
mailchimp__memberscould be significantly different and should be highlighted.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?
dbt buildwas successful, previously duplicated rows have been combined.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.