diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e0e54..f573dcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## Under the hood ## Fixes +# edu_edfi_source v0.4.1 +## Fixes +- Fix surrogate key creation for `stg_ef3__student_contact_associations` to properly hanlde lowering of alphanumeric columns that are part of natural keys + # edu_edfi_source v0.4.0 ## New features - Add `stg_ef3__stu_ed_org__cohort_years` tracking student cohort designations (flattens Ed-Fi collection `cohort_years` for easier downstream use) diff --git a/dbt_project.yml b/dbt_project.yml index 9abc715..87d41c3 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'edu_edfi_source' -version: '0.4.0' +version: '0.4.1' require-dbt-version: [">=1.0.0", "<2.0.0"] # This setting configures which "profile" dbt uses for this project. diff --git a/models/staging/edfi_3/stage/stg_ef3__student_contact_associations.sql b/models/staging/edfi_3/stage/stg_ef3__student_contact_associations.sql index 984f368..365ead2 100644 --- a/models/staging/edfi_3/stage/stg_ef3__student_contact_associations.sql +++ b/models/staging/edfi_3/stage/stg_ef3__student_contact_associations.sql @@ -22,7 +22,7 @@ keyed as ( select {{ gen_skey('k_student') }}, -- we can't use the gen_skey macro here because we're bringing in the deprecated parents endpoint data, which contains a parentReference that won't work - {{ dbt_utils.generate_surrogate_key(['tenant_code', 'contact_unique_id']) }} as k_contact, + {{ dbt_utils.generate_surrogate_key(['tenant_code', 'lower(contact_unique_id)']) }} as k_contact, {{ gen_skey('k_student_xyear') }}, api_year as school_year, unioned.*