From cc6966426e756dec667845c0bafbcd32f5d2e3d1 Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Mon, 4 May 2026 12:05:54 -0400 Subject: [PATCH 1/8] Add sedm models required for child count --- models/sedm_warehouse/fct_idea_event.sql | 43 +++++++++++++++++ models/sedm_warehouse/fct_student_iep.sql | 48 +++++++++++++++++++ .../fct_student_iep_disability.sql | 27 +++++++++++ 3 files changed, 118 insertions(+) create mode 100644 models/sedm_warehouse/fct_idea_event.sql create mode 100644 models/sedm_warehouse/fct_student_iep.sql create mode 100644 models/sedm_warehouse/fct_student_iep_disability.sql diff --git a/models/sedm_warehouse/fct_idea_event.sql b/models/sedm_warehouse/fct_idea_event.sql new file mode 100644 index 00000000..bf5b5b8d --- /dev/null +++ b/models/sedm_warehouse/fct_idea_event.sql @@ -0,0 +1,43 @@ +{{ + config( + post_hook=[ + "alter table {{ this }} alter column k_idea_event set not null", + "alter table {{ this }} alter column k_student set not null", + "alter table {{ this }} alter column k_student_xyear set not null", + "alter table {{ this }} add primary key (k_idea_event)", + "alter table {{ this }} add constraint fk_{{ this.name }}_student foreign key (k_student) references {{ ref('dim_student') }}", + ] + ) +}} + +with stage as ( + select * from {{ ref('stg_sedm__idea_events') }} +), + +dim_student as ( + select * from {{ ref('dim_student') }} +), + +formatted as ( + select + stage.k_idea_event, + dim_student.k_student, + dim_student.k_student_xyear, + stage.tenant_code, + stage.school_year, + stage.idea_event_id, + stage.ed_org_id, + stage.ed_org_type, + stage.idea_event, + stage.event_begin_date, + stage.event_end_date, + stage.event_narrative, + stage.event_reason, + stage.event_compliance + {{ edu_edfi_source.extract_extension(model_name='stg_sedm__idea_events', flatten=False) }} + from stage + inner join dim_student + on stage.k_student = dim_student.k_student +) + +select * from formatted diff --git a/models/sedm_warehouse/fct_student_iep.sql b/models/sedm_warehouse/fct_student_iep.sql new file mode 100644 index 00000000..2d6b9111 --- /dev/null +++ b/models/sedm_warehouse/fct_student_iep.sql @@ -0,0 +1,48 @@ +{{ + config( + post_hook=[ + "alter table {{ this }} alter column k_student_iep set not null", + "alter table {{ this }} alter column k_student set not null", + "alter table {{ this }} alter column k_student_xyear set not null", + "alter table {{ this }} add primary key (k_student_iep)", + "alter table {{ this }} add constraint fk_{{ this.name }}_student foreign key (k_student) references {{ ref('dim_student') }}", + ] + ) +}} + +with stage as ( + select * from {{ ref('stg_sedm__student_ieps') }} +), + +dim_student as ( + select * from {{ ref('dim_student') }} +), + +formatted as ( + select + stage.k_student_iep, + dim_student.k_student, + dim_student.k_student_xyear, + stage.tenant_code, + stage.school_year, + stage.student_iep_association_id, + stage.ed_org_id, + stage.ed_org_type, + stage.iep_finalized_date, + stage.iep_begin_date, + stage.iep_end_date, + stage.iep_amended_date, + stage.iep_status, + stage.reason_exited, + stage.special_education_setting, + stage.is_medically_fragile, + stage.is_multiply_disabled, + stage.school_hours_per_week, + stage.special_education_hours_per_week + {{ edu_edfi_source.extract_extension(model_name='stg_sedm__student_ieps', flatten=False) }} + from stage + inner join dim_student + on stage.k_student = dim_student.k_student +) + +select * from formatted diff --git a/models/sedm_warehouse/fct_student_iep_disability.sql b/models/sedm_warehouse/fct_student_iep_disability.sql new file mode 100644 index 00000000..22310ff5 --- /dev/null +++ b/models/sedm_warehouse/fct_student_iep_disability.sql @@ -0,0 +1,27 @@ +{{ + config( + post_hook=[ + "alter table {{ this }} add constraint fk_{{ this.name }}_student_iep foreign key (k_student_iep) references {{ ref('fct_student_iep') }}", + ] + ) +}} + +with disabilities as ( + select * from {{ ref('stg_sedm__student_iep_disability_collections') }} +), + +formatted as ( + select + disabilities.k_student_iep, + disabilities.tenant_code, + disabilities.school_year, + disabilities.ed_org_id, + disabilities.disability_descriptor, + disabilities.disability_determination_source_type_descriptor, + disabilities.disability_diagnosis, + disabilities.order_of_disability + {{ edu_edfi_source.extract_extension(model_name='stg_sedm__student_iep_disability_collections', flatten=False) }} + from disabilities +) + +select * from formatted From 10728019b32716203c170849e5c6bf9349b9b42c Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Fri, 15 May 2026 06:47:11 -0400 Subject: [PATCH 2/8] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec85d368..21c5b868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased ## New features +- Add fct models `fct_student_iep`, `fct_idea_event`, and `fct_student_iep_disability` ## Under the hood ## Fixes From b0caf490d62e4a449a5988907d3c7d0eff93d5f7 Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Fri, 15 May 2026 09:18:43 -0400 Subject: [PATCH 3/8] Add model ymls --- models/sedm_warehouse/fct_idea_event.yml | 44 +++++++++++++++++ models/sedm_warehouse/fct_student_iep.yml | 49 +++++++++++++++++++ .../fct_student_iep_disability.yml | 39 +++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 models/sedm_warehouse/fct_idea_event.yml create mode 100644 models/sedm_warehouse/fct_student_iep.yml create mode 100644 models/sedm_warehouse/fct_student_iep_disability.yml diff --git a/models/sedm_warehouse/fct_idea_event.yml b/models/sedm_warehouse/fct_idea_event.yml new file mode 100644 index 00000000..e33d16a1 --- /dev/null +++ b/models/sedm_warehouse/fct_idea_event.yml @@ -0,0 +1,44 @@ +version: 2 + +models: + - name: fct_idea_event + description: > + ##### Overview: + This fact table contains IDEA-related events for students (for example, meetings, + evaluations, or other documented IDEA processes), keyed to the warehouse student. + + ##### Primary Key: + `k_idea_event` -- There is one record per IDEA event association in the source data. + + config: + tags: ['sedm'] + + constraints: + - type: primary_key + columns: [k_idea_event] + - type: foreign_key + name: fk__fct_idea_event__k_student + columns: [k_student] + to: ref('dim_student') + to_columns: [k_student] + + columns: + - name: k_idea_event + tests: + - unique + - not_null + - name: k_student + description: Defining key for the student in this school year. + - name: k_student_xyear + description: Defining key for the student, which is consistent across years. + - name: tenant_code + - name: school_year + - name: idea_event_id + - name: ed_org_id + - name: ed_org_type + - name: idea_event + - name: event_begin_date + - name: event_end_date + - name: event_narrative + - name: event_reason + - name: event_compliance diff --git a/models/sedm_warehouse/fct_student_iep.yml b/models/sedm_warehouse/fct_student_iep.yml new file mode 100644 index 00000000..2a83bf42 --- /dev/null +++ b/models/sedm_warehouse/fct_student_iep.yml @@ -0,0 +1,49 @@ +version: 2 + +models: + - name: fct_student_iep + description: > + ##### Overview: + This fact table contains student Individualized Education Program (IEP) records, + keyed to the warehouse student. + + ##### Primary Key: + `k_student_iep` -- There is one record per student IEP association in the source data. + + config: + tags: ['sedm'] + + constraints: + - type: primary_key + columns: [k_student_iep] + - type: foreign_key + name: fk__fct_student_iep__k_student + columns: [k_student] + to: ref('dim_student') + to_columns: [k_student] + + columns: + - name: k_student_iep + tests: + - unique + - not_null + - name: k_student + description: Defining key for the student in this school year. + - name: k_student_xyear + description: Defining key for the student, which is consistent across years. + - name: tenant_code + - name: school_year + - name: student_iep_association_id + - name: ed_org_id + - name: ed_org_type + - name: iep_finalized_date + - name: iep_begin_date + - name: iep_end_date + - name: iep_amended_date + - name: iep_status + - name: reason_exited + - name: special_education_setting + - name: is_medically_fragile + - name: is_multiply_disabled + - name: school_hours_per_week + - name: special_education_hours_per_week diff --git a/models/sedm_warehouse/fct_student_iep_disability.yml b/models/sedm_warehouse/fct_student_iep_disability.yml new file mode 100644 index 00000000..01538c11 --- /dev/null +++ b/models/sedm_warehouse/fct_student_iep_disability.yml @@ -0,0 +1,39 @@ +version: 2 + +models: + - name: fct_student_iep_disability + description: > + ##### Overview: + This fact table lists disabilities associated with each student IEP, as recorded + in the source disability collection. + + ##### Grain: + One row per IEP disability entry, typically unique by `k_student_iep` and + `order_of_disability`. + + config: + tags: ['sedm'] + + constraints: + - type: foreign_key + name: fk__fct_student_iep_disability__k_student_iep + columns: [k_student_iep] + to: ref('fct_student_iep') + to_columns: [k_student_iep] + + tests: + - dbt_utils.unique_combination_of_columns: + arguments: + combination_of_columns: + - k_student_iep + - order_of_disability + + columns: + - name: k_student_iep + - name: tenant_code + - name: school_year + - name: ed_org_id + - name: disability_descriptor + - name: disability_determination_source_type_descriptor + - name: disability_diagnosis + - name: order_of_disability From 6c3de2fe8639cac213e156aee9844da7bb0de848 Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Fri, 15 May 2026 09:41:35 -0400 Subject: [PATCH 4/8] Add schema and enabled var --- dbt_project.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbt_project.yml b/dbt_project.yml index 859ecfc0..b1b08a98 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -29,6 +29,9 @@ models: +enabled: "{{ var('edu:tpdm:enabled', False) }}" core_warehouse: +schema: wh + sedm_warehouse: + +schema: wh + +enabled: "{{ var('edu:sedm:enabled', False) }}" tpdm_warehouse: +schema: wh +enabled: "{{ var('edu:tpdm:enabled', False) }}" From 9cb13218097d16a9bb78ef0bde53552d9d9831ad Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Fri, 15 May 2026 10:29:05 -0400 Subject: [PATCH 5/8] Add enable var to individual model ymls --- models/sedm_warehouse/fct_idea_event.yml | 1 + models/sedm_warehouse/fct_student_iep.yml | 1 + models/sedm_warehouse/fct_student_iep_disability.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/models/sedm_warehouse/fct_idea_event.yml b/models/sedm_warehouse/fct_idea_event.yml index e33d16a1..f1da1cc5 100644 --- a/models/sedm_warehouse/fct_idea_event.yml +++ b/models/sedm_warehouse/fct_idea_event.yml @@ -12,6 +12,7 @@ models: config: tags: ['sedm'] + enabled: "{{ var('edu:sedm:enabled', False) }}" constraints: - type: primary_key diff --git a/models/sedm_warehouse/fct_student_iep.yml b/models/sedm_warehouse/fct_student_iep.yml index 2a83bf42..c95d3bb8 100644 --- a/models/sedm_warehouse/fct_student_iep.yml +++ b/models/sedm_warehouse/fct_student_iep.yml @@ -12,6 +12,7 @@ models: config: tags: ['sedm'] + enabled: "{{ var('edu:sedm:enabled', False) }}" constraints: - type: primary_key diff --git a/models/sedm_warehouse/fct_student_iep_disability.yml b/models/sedm_warehouse/fct_student_iep_disability.yml index 01538c11..576787eb 100644 --- a/models/sedm_warehouse/fct_student_iep_disability.yml +++ b/models/sedm_warehouse/fct_student_iep_disability.yml @@ -13,6 +13,7 @@ models: config: tags: ['sedm'] + enabled: "{{ var('edu:sedm:enabled', False) }}" constraints: - type: foreign_key From 26ec0afbe596997837cd8c9b9f5cec23a2c25003 Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Fri, 15 May 2026 12:46:27 -0400 Subject: [PATCH 6/8] Add breaking change flag to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21c5b868..441c6ca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Unreleased ## New features -- Add fct models `fct_student_iep`, `fct_idea_event`, and `fct_student_iep_disability` +- **Breaking Change**: Add fct models `fct_student_iep`, `fct_idea_event`, and `fct_student_iep_disability`. These new models require adding the corresponding sources. ## Under the hood ## Fixes From 5016fe43f43fc6e097df66a41f65e00f5497ec2b Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Tue, 19 May 2026 06:40:55 -0400 Subject: [PATCH 7/8] Add idea specific field descriptions --- models/sedm_warehouse/fct_idea_event.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/models/sedm_warehouse/fct_idea_event.yml b/models/sedm_warehouse/fct_idea_event.yml index f1da1cc5..51c9833b 100644 --- a/models/sedm_warehouse/fct_idea_event.yml +++ b/models/sedm_warehouse/fct_idea_event.yml @@ -35,11 +35,18 @@ models: - name: tenant_code - name: school_year - name: idea_event_id + description: A unique identifier for the event record as assigned by the provider of IEP services. - name: ed_org_id - name: ed_org_type - name: idea_event + description: The specific legal step, procedure, or standard event milestone captured as part of IDEA compliance requirements. - name: event_begin_date + description: The date when the IDEA related event started. - name: event_end_date + description: The date when the IDEA related event concluded. - name: event_narrative + description: Detailed and summary notes recorded during the event. - name: event_reason + description: The reason why the IDEA event occurred. - name: event_compliance + description: The type of compliance represented by this event. From 71f97b1245b16cb6a2035b9be6e648d4e37b767d Mon Sep 17 00:00:00 2001 From: Ryan Aguilar Date: Tue, 19 May 2026 07:14:55 -0400 Subject: [PATCH 8/8] Add standard col descriptions --- models/sedm_warehouse/fct_idea_event.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/models/sedm_warehouse/fct_idea_event.yml b/models/sedm_warehouse/fct_idea_event.yml index 51c9833b..0e6b99a3 100644 --- a/models/sedm_warehouse/fct_idea_event.yml +++ b/models/sedm_warehouse/fct_idea_event.yml @@ -33,11 +33,19 @@ models: - name: k_student_xyear description: Defining key for the student, which is consistent across years. - name: tenant_code + description: The tenant associated with the record. - name: school_year + description: > + School year specified by Spring year. + e.g. the 2021-2022 year would be 2022. - name: idea_event_id description: A unique identifier for the event record as assigned by the provider of IEP services. - name: ed_org_id + description: The identifier for the educational organization associated with the IDEA event. - name: ed_org_type + description: > + The type of educational organization + e.g., School or LocalEducationAgency. - name: idea_event description: The specific legal step, procedure, or standard event milestone captured as part of IDEA compliance requirements. - name: event_begin_date