-
Notifications
You must be signed in to change notification settings - Fork 3
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
Simplify base events this run #64
Simplify base events this run #64
Conversation
3a68e11
to
9ec160a
Compare
macros/snowplow_media_player_base_events_this_run/get_context_fields.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.
LGTM! Very nice refactor, so much cleaner and easier to follow than my macros!
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.
Just one actual change required, the rest are just questions/nitpicks!
macros/snowplow_media_player_base_events_this_run/snakeify_case.sql
Outdated
Show resolved
Hide resolved
macros/snowplow_media_player_base_events_this_run/get_enabled_context_fields.sql
Outdated
Show resolved
Hide resolved
macros/snowplow_media_player_base_events_this_run/media_event_type_field.sql
Outdated
Show resolved
Hide resolved
models/base/scratch/snowplow_media_player_base_events_this_run.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.
Just one actual change required, the rest are just questions/nitpicks!
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.
Looks good to me!
58ee495
to
ca476e4
Compare
0f8a74f
into
release/snowplow-media-player/0.7.0
Description & motivation
Refactor the
snowplow_media_player_base_events_this_run
table into a single model for a cleaner and less error prone approach, similar to what we do in the unified package.The model uses a single macro
get_context_fields
which gets all the specified fields for a specified context. If the context isn't enabled it will cast nulls for those fields so they are still available downstream. This means we now only need to specify the context fields once in one file.Each item in fields must match what is set in the iglu schema
{'field':'breakType', 'dtype':'string'}
. The outputted field has an alias prefix that will match the postgres/redshift alias prefix created from the base macro query.In doing the refactor we also resolve issue #60. An integration test run for a v2 only configuration has been added to cover this case.
Checklist