Skip to content

Commit 5884ee1

Browse files
authored
PATCH: lower key in stu_contact_assoc (#109)
* need to lower the string before keying * Update CHANGELOG.md * Update dbt_project.yml
1 parent c2baa25 commit 5884ee1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
## Under the hood
44
## Fixes
55

6+
# edu_edfi_source v0.4.1
7+
## Fixes
8+
- Fix surrogate key creation for `stg_ef3__student_contact_associations` to properly hanlde lowering of alphanumeric columns that are part of natural keys
9+
610
# edu_edfi_source v0.4.0
711
## New features
812
- Add `stg_ef3__stu_ed_org__cohort_years` tracking student cohort designations (flattens Ed-Fi collection `cohort_years` for easier downstream use)

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
config-version: 2
22

33
name: 'edu_edfi_source'
4-
version: '0.4.0'
4+
version: '0.4.1'
55
require-dbt-version: [">=1.0.0", "<2.0.0"]
66

77
# This setting configures which "profile" dbt uses for this project.

models/staging/edfi_3/stage/stg_ef3__student_contact_associations.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ keyed as (
2222
select
2323
{{ gen_skey('k_student') }},
2424
-- 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
25-
{{ dbt_utils.generate_surrogate_key(['tenant_code', 'contact_unique_id']) }} as k_contact,
25+
{{ dbt_utils.generate_surrogate_key(['tenant_code', 'lower(contact_unique_id)']) }} as k_contact,
2626
{{ gen_skey('k_student_xyear') }},
2727
api_year as school_year,
2828
unioned.*

0 commit comments

Comments
 (0)