-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/fct school acquisition metrics #52
Feature/fct school acquisition metrics #52
Conversation
updated descritpion on PR front page
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.
made some minor formatting changes and added tests/documentation. Although the code looks convoluted, I can see how it runs faster than the alternative approach mapped out. Tested the build and verified the table for a few school years- all looks good!
dbt/models/marts/metrics/fct_weekly_school_acquisition_metrics.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.
niiiice
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.
the school_level_simple
logic is redundant here, let's remove and go back to the bit
fields we are pre-processing for you in the base/staging layers and providing in dim_schools
select | ||
school_year, | ||
sssy.school_year, | ||
school_level_simple, |
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.
best practice here is to attach an alias to each column when joining (eg. sssy.school_year
)
where status like 'active %' | ||
group by 1,2,3,4,5 | ||
group by 1,2,3,4,5,6,7 |
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.
{{ dbt_utils.group_by(7) }}
… feature/fct_school_acquisition_metrics
… feature/fct_school_acquisition_metrics
Description
This PR is a second pass at defining a weekly school acquisition metrics table for use with MIR.
int_school_weeks
A major contribution to this PR is the definition of a new intermediate table called
int_school_weeks
. The attempt here is to solve the problem of how to align school year weeks with standard ISO weeks and this table proposes a solution. (This issue is mentioned in this ticket)Please read the comments in the code, and the methodology of
int_school_weeks
carefully because it will define how we define weeks of the school year moving forward. Its design is an attempt to mimicint_school_years
in terms of how analysts or modelers would join to it, and also to not conflict with what have become our standard school year boundaries.I think that is a good solution moving forward, and better than what we currently use in terms of standardizing school weeks. It will mean validation might get tricky because some schools might shift from one schoolyard to another based on how we currently do reporting, but I think those differences well in the end be marginal and it's worth this change to standardize the way we segment data by weeks of the school year.
**THIS PR IS LARGELY ABOUT APPROVING
int_school_weeks
and merging it into main.The weekly school acquisition metrics code, was updated to incorporate this new table, but follow up work is to validate.
Followup work