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.
Description & motivation
This PR addresses an edge case that occured in the BPS Stadium implementation where a student had multiple enrollments associated with different calendars per enrollment, which resulted in a student's attendance event not contributing to their attendance count.
Currently, the attendance_event_date is converted into a k_calendar_date by joining to fct_student_school_association and deduping by selecting enrollments where is_latest_annual_entry is true.
This updated model would instead join so that the attendance_event_date is within the range of the enrollment's entry_date and exit_withdraw_date (and accounts for null exit_withdraw_dates).
However, if a student has overlapping enrollments at the same school, multiple rows will
be returned for each date, and so an additional deduplication step is introduced.
See the original Monday item here.
Breaking changes introduced by this PR:
No breaking changes, but in rare cases could change attendance count.
PR Merge Priority:
Changes to existing files:
New files created:
Tests and QC done:
Future ToDos & Questions:
edu_wh PR Review Checklist:
Make sure the following have been completed before approving this PR:
## New Features
for features, etc.