feature/:Enhanced dim_course_section to expose section_characteristics descriptors#231
Conversation
AngelicaLastra
left a comment
There was a problem hiding this comment.
@smckee-tnedu this is a really clean PR! Thank you for catching this gap in the dim_course_section model!
There are a few small things to clean up before merge, but they are very small:
-
In
bld_ef3__section__wide_section_characteristics:left outer joinshould beleft jointo match every other model in the repo.- I am wondering if we need the
outer=True? what is the benefit of pushing through rows without a section characteristic?
-
In
dim_course_section:- The comment
-- todo: add characteristic indicatorson line 80 is stale, we should remove it so it doesn't cause confusion in the future.
- The comment
On the YML side, three things need to be added:
bld_ef3__section__wide_section_characteristicsis not registered in_edfi_3__courses.yml. It needs an entry withconfig: tags: ['core']and a column entry forsection_characteristics_arrayto match the pattern established bybld_ef3__course_char__combined_wide.- In
dim_course_section.yml,section_characteristics_arrayis missing a column entry (thecourse_level_characteristics_arrayentry is a good template to follow). The "Important Business Rules" block in the model description also only referencesxwalk_course_level_characteristicsand the course-levelis_*columns; it should be updated to mentionxwalk_section_characteristicsand the section-level indicator columns as well.
These are all very minor, final touch up changes. The code runs successfully, does what it intends to do, and does not negatively affect grain or other aspects of the model. Thank you again for this work!
| stg_ef3__sections.available_credit_type, | ||
| stg_ef3__sections.available_credit_conversion | ||
|
|
||
| -- todo: add characteristic indicators |
There was a problem hiding this comment.
Since we are adding them now through this PR, we no longer need the stale todo. We can remove this comment to ensure we don't cause confusion in the future.
| ) }} | ||
| {%- endif %} | ||
| from flattened | ||
| left outer join xwalk_section_characteristics |
There was a problem hiding this comment.
Very small, picky thing, can we use left join instead? It's the standard for the repo even if it means the same thing.
There was a problem hiding this comment.
You can, yes. They mean the same but I've always used the word "outer" just because in my history in IT (I'm old) I've always trained junior developers and explicitly saying "outer" has been helpful in reducing confusion.
| k_course_section, | ||
| {{ edu_edfi_source.extract_descriptor('section_chars.value:sectionCharacteristicDescriptor::string') }} as section_characteristic | ||
| from sections | ||
| {{ edu_edfi_source.json_flatten('v_section_characteristics', 'section_chars', outer=true) }} |
There was a problem hiding this comment.
I wonder if we need the outer=true here? What would be the benefit of creating rows for course sections without characteristics for this model?
There was a problem hiding this comment.
I don't think it's needed. I'ts been awhile since I wrote this but I might have been thinking that I saw outer=true as sort of a standard you guys were doing for these things? So that maybe if you had to troubleshoot data in the table, you'd have all the rows to look at and not just the rows that contained useful data? I don't know, to be honest.
|
marking for 0.7.0 because it requires xwalk update. very likely to release in ~August |
Description & motivation
After the fix for course_level_characteristics, the visibility of section characteristics was gone. This set of changes brings that visibility back.
Breaking changes introduced by this PR:
This change requires a new xwalk:
xwalk_section_characteristics.csv. An example looks like this:PR Merge Priority:
Changes to existing files:
models/core_warehouse/dim_course_section.sql: Uses a new build model to expose the descriptors that come in on the sections_characteristics field.New files created:
models/build/edfi_3/courses/bld_ef3__section__wide_section_characteristics.sql: Builds a set of wide columns that can be accordioned in dim_course_section.Tests and QC done:
This has been tested within stadium_tennessee.
edu_wh PR Review Checklist:
Make sure the following have been completed before approving this PR:
## New Featuresfor features, etc.