Skip to content

Conversation

@smckee-tnedu
Copy link
Contributor

@smckee-tnedu smckee-tnedu commented Jan 2, 2026

There are several enhancements/fixes across Student Program Association staging tables in this commit.

  1. Added a k_student_program surrogate key to all the student program association staging tables.
  2. Critically, modifies the dedupe CTE for all Student Program Associations to dedupe by k_student_program. This fixes a bug in how these models are deduped because they are currently deduping without the entire endpoint PK. This bug surfaces when a Program Ed Org is defined at different level than the Program Association Ed Org and a Student is associated with the same Program at two different Association Ed Orgs. For example, imagine a Program definition at a District level, but a Student within that District is associated with this Program at two different Schools (perhaps they switched Schools midyear), then the current implementation will dedupe these two Association rows down into just one row, even though the Association exists at two different Schools.
  3. Adds ed_org_id to pretty much all the tables since this is part of the endpoint PK.
  4. For Program Services, there is a fact table in edu_wh that exposes program services for all the programs, but there is a generic program endpoint for which the fact table doesn't include. I have created a staging table for this generic program service.
  5. For Disabilities, I have modified an existing disabilities staging table (for spec ed) but also added a disabilities staging table for ed org since disabilities can be on both locations.
  6. Exposes Program Participation Statuses into staging tables across all the Student Program Association models (just like Program Services)

This commit exposes
- Program Participation Statuses across all the student program association models
- Adds ed_org_id to every Student Program Association table (since it is part of the PK)
- Exposes the Student Generic Program Service like all the other Program Services (this seems to be a miss)
- Critically, modifies the dedupe CTE for all Student Program Associations to include ed_org_id in the partition_by. This fixes a bug in how these models are deduped because they are currently deduping without the entire endpoint PK.
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.

1 participant