feat: renumber duplicate keys only on relevant course fields#144
Open
nm3224 wants to merge 3 commits into
Open
feat: renumber duplicate keys only on relevant course fields#144nm3224 wants to merge 3 commits into
nm3224 wants to merge 3 commits into
Conversation
PDP and Edvise schema duplicate handling now share a clear rule: suffix course_number only when the duplicate-key group disagrees on course classification/type, course name, credits attempted or earned, or grade (relevant fields we care about). Otherwise - collapse to one row per key (arbitrary dropping).
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.
Primary Keys for course records now also include: section_id.
BUT: if section_id has >75% null/missing values, exclude it from primary keys and proceed without it.
PDP and Edvise schema duplicate handling now share a clear rule: suffix course_number only when the duplicate-key group disagrees on course classification/type, course name, credits attempted or earned, or grade (relevant fields we care about). Otherwise - collapse to one row per key (arbitrary dropping). The kept row is chosen deterministically as the first index in the group.
How this changes our student-term features:
For scalar ("course_id", catalog) in sum_val_equal_cols_by_group, course_id values that are renumbered variants of the catalog id (e.g. ENG101-1 for ENG101) are counted toward num_courses_course_id_*, so key-course counts can reflect multiple rows in a term after dedupe. This captured important information around students re-taking courses which was otherwise dropped.
New unit tests added to ensure things are working as expected.