Skip to content

Bugfix/attendance calendars from bell schedules#88

Draft
sleblanc23 wants to merge 3 commits intomainfrom
bugfix/att_calendars_from_bell_schedules
Draft

Bugfix/attendance calendars from bell schedules#88
sleblanc23 wants to merge 3 commits intomainfrom
bugfix/att_calendars_from_bell_schedules

Conversation

@sleblanc23
Copy link
Copy Markdown
Contributor

Description & motivation

Addresses an edge case in the fct_student_daily_attendance model. Students who only attend school part-time (only on Tuesday/Thursday, for example) are currently shown to be in attendance on days they don't go to school. This PR fixes that by constructing the calendar of possible attendance days for each student based on their class schedules.

Changes to existing files:

  • fct_student_daily_attendance : Replace the calendar-constructing steps with a join to the newly added build model.

New files created:

  • bld_ef3__student_school_days : Constructs the student-school level instructional calendars, including logic that was previously in fct_student_daily_attendance for removing non-instructional days and any that fall outside the student's enrollment. Put this in a separate model to keep it readable given of the large number of joins required.

Tests and QC done:

Confirmed that it fixed the identified edge cases without creating any new inaccuracies for three schools in Jeffco. Additional QC to be done before marking ready for review.

Future ToDos & Questions:

It's possible that this creates more problems than it solves when bell schedule data is bad or incomplete.

PR Merge Priority:

Copy link
Copy Markdown
Contributor

@ejoranlienea ejoranlienea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would anything change about this object if the following joins were removed?

  • course_section
  • class_period
  • bell

It looks like in each of these cases, the subsequent joins use the same keys that are already present and nothing else from these objects is used directly, so we may be able to trim this down by a few joins without affecting anything.

inner join bell_dates
on bell.k_bell_schedule = bell_dates.k_bell_schedule
-- limit to the duration of the section enrollment
where bell_dates.calendar_date between student_section_enr.begin_date and student_section_enr.end_date
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to handle nulls in end_date here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants