Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use calendars rather than enrollments for tenant lea ownership #155

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased
## New features
## Under the hood
- Tweak tenant-lea attribution logic
## Fixes

# edu_wh v0.4.0
Expand Down
10 changes: 5 additions & 5 deletions models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
-- each tenant individually define each district and school, and only
-- keep the definition from the tenant that actually has ownership
-- since the relationship between tenant and district is not codified anywhere,
-- we observe it from student enrollments.
select distinct ssa.tenant_code, lea_id
from {{ ref('stg_ef3__student_school_associations') }} ssa
join {{ ref('stg_ef3__schools') }} sch
on ssa.k_school = sch.k_school
-- we observe it from calendars
select distinct sch.tenant_code, sch.lea_id
from {{ ref('stg_ef3__calendars') }} as cal
join {{ ref('stg_ef3__schools') }} as sch
on cal.k_school = sch.k_school