Skip to content

Add student's birth country to dim_student#178

Merged
rlittle08 merged 2 commits into
mainfrom
feature/stad62-add-birth-country-to-dim-student
Jul 18, 2025
Merged

Add student's birth country to dim_student#178
rlittle08 merged 2 commits into
mainfrom
feature/stad62-add-birth-country-to-dim-student

Conversation

@jabortell
Copy link
Copy Markdown
Contributor

@jabortell jabortell commented Jul 14, 2025

Description & motivation

This PR is part of our work to keep the data model up to date. Currently we're already extracting/setting stg_ef3__students.birth_country in the edu_edfi_source package. Now, we're passing this column to bld_ef3__immutable_stu_demos, then upstream to dim_student.

As part of the bld_ef3__immutable_stu_demos model, whether birth_country has the grain tenant+student+year or tenant+student is determined by the configuration variable edu:stu_demos:make_demos_immutable, along with related demographics such as birth_date.

Ed-Fi recommends that SIS' populate birth country with only ISO 3166 2-letter country codes. See the entry in the data handbook here. Our added column birth_country is just a pass-through -- analysts should double-check that country values are consistent.

Breaking changes introduced by this PR:

birth_country will be available in three models:

  • stg_ef3__students from the edu_edfi_source package
  • bld_ef3__immutable_stu_demos
  • dim_student

Folks should review any queries that select from the changed models to ensure that birth_country will not be selected multiple times.

PR Merge Priority:

  • Low
  • Medium
  • High

Changes to existing files:

  • bld_ef3__immutable_stu_demos: Added column birth_country from stg_ef3__students.birth_country
  • dim_student: Added column birth_country from bld_ef3__immutable_stu_demos.birth_country

New files created:

No new files created.

Tests and QC done:

  • Executed a dbt project run in a dev environment, and it was successful
  • dim_student.birth_country was mostly populated and with the ISO 2-letter country codes.

edu_wh PR Review Checklist:

Make sure the following have been completed before approving this PR:

  • Description of changes has been added to Unreleased section of CHANGELOG.md. Add under ## New Features for features, etc.
  • If a new configuration xwalk was added:
    • The code is written such that the xwalk is optional (preferred), and this behavior was tested, OR
    • The code is written such that the xwalk is required, and the required xwalk is added to edu_project_template, and this PR is flagged as breaking change (not for patch release)
    • A description for the new xwalk has been added to EDU documentation site here
  • If a new configuration variable was added:
    • The code is written such that the variable is optional (preferred), and this behavior was tested, OR
    • The code is written such that the variable is required, and a default value was added to edu_project_template, and this PR is flagged as breaking change (not for patch release)
    • A description for the new variable has been added to EDU documentation site here
  • Reviewer confirms the grain of all tables are unchanged, OR any changes are expected, communicated, and this PR is flagged as a breaking change (not for patch release)

@jabortell jabortell requested a review from rlittle08 July 14, 2025 14:03
@jabortell
Copy link
Copy Markdown
Contributor Author

Ope, I'm noticing that a number of lines in the changed files are showing updates from trimming trailing whitespace (probably from my vscode settings). Let me know if that should be reverted.

@rlittle08
Copy link
Copy Markdown
Collaborator

Ope, I'm noticing that a number of lines in the changed files are showing updates from trimming trailing whitespace (probably from my vscode settings). Let me know if that should be reverted.

no problem, we can leave. We have on the backlog a task to look into SQL linters to standardize whitespace etc

@rlittle08
Copy link
Copy Markdown
Collaborator

@jabortell all looks great. Note, if implementations want to replace the codes with full names, they can use EDU's built-in functionality to replace descriptor code values with long/short descriptions. Once configured, the code in extract_descriptor will replace with values you can see here:

select * from analytics.prod_stage.int_ef3__deduped_descriptors
where namespace ilike '%CountryD%';

@rlittle08 rlittle08 merged commit dfdc88b into main Jul 18, 2025
@rlittle08 rlittle08 deleted the feature/stad62-add-birth-country-to-dim-student branch July 18, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants