From dcf8720fcee91f276630c6546390e7ec276995b2 Mon Sep 17 00:00:00 2001 From: ejoranlien Date: Thu, 3 Oct 2024 13:43:22 -0500 Subject: [PATCH 1/2] use calendars rather than enrollments for tenant id --- models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql b/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql index 7fe3bb7e..bac8dbe1 100644 --- a/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql +++ b/models/build/edfi_3/bld_ef3__tenant_lea_ownership.sql @@ -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 \ No newline at end of file +-- 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 From 1b133ab76b7a7f7ed451124053eac9feb8b814e2 Mon Sep 17 00:00:00 2001 From: ejoranlien Date: Thu, 3 Oct 2024 13:46:07 -0500 Subject: [PATCH 2/2] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0af66df..d3f258c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Unreleased ## New features ## Under the hood +- Tweak tenant-lea attribution logic ## Fixes # edu_wh v0.4.0