-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/epdm models: create fct and dim tables for performance-based assessment of educator candidates #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
oscarrezab
wants to merge
4
commits into
main
Choose a base branch
from
feature/epdm_models
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6008c37
Create dim_candidate, dim_performance_evaluation, and fct_candidate_a…
oscarrezab 0413d09
Add primary key to dim tables
oscarrezab e17ec3f
Create yml for warehouse tables
oscarrezab f766569
Remove key from fact table and fix join in dim
oscarrezab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| {{ | ||
| config( | ||
| post_hook=[ | ||
| "alter table {{ this }} add primary key (k_candidate)" | ||
| ] | ||
| ) | ||
| }} | ||
|
|
||
| with stg_candidates as ( | ||
| select * from {{ ref('stg_tpdm__candidates') }} | ||
| ), | ||
|
|
||
| formatted as ( | ||
| select | ||
| k_candidate, | ||
| k_person, | ||
| tenant_code, | ||
| api_year, | ||
| candidate_id, | ||
| person_id, | ||
| first_name, | ||
| last_name, | ||
| middle_name, | ||
| maiden_name, | ||
| generation_code_suffix, | ||
| personal_title_prefix, | ||
| preferred_first_name, | ||
| preferred_last_name, | ||
| birth_city, | ||
| birth_date, | ||
| birth_international_province, | ||
| date_entered_us, | ||
| displacement_status, | ||
| is_economic_disadvantaged, | ||
| is_first_generation_student, | ||
| has_hispanic_latino_ethnicity, | ||
| is_multiple_birth, | ||
| gender, | ||
| sex, | ||
| birth_sex, | ||
| birth_state, | ||
| birth_country, | ||
| english_language_exam, | ||
| lep_code, | ||
| v_addresses, | ||
| v_disabilities, | ||
| v_emails, | ||
| v_languages, | ||
| v_other_names, | ||
| v_personal_identification_documents, | ||
| v_races, | ||
| v_telephones | ||
| from stg_candidates | ||
| ) | ||
|
|
||
| select * from formatted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| version: 2 | ||
|
|
||
| models: | ||
| - name: dim_candidate | ||
| description: > | ||
| ##### Overview: | ||
| Defines an educator candidate. | ||
|
|
||
| ##### Primary Key: | ||
| `k_candidate` - There is one record per candidate | ||
| config: | ||
| tags: ['tpdm'] | ||
| columns: | ||
| - name: k_candidate | ||
| description: generated primary key from `tenant_code`, `api_year`, and `candidate_id` | ||
| tests: | ||
| - unique | ||
| - name: k_person | ||
| description: "Generated surrogate key from `tenant_code`, `api_year`, `person_id`, and `source_system`" | ||
| - name: tenant_code | ||
| description: "Code defining the Tenant (may be an LEA, SEA, etc.) of the Ed-Fi ODS from which this record was pulled" | ||
| - name: api_year | ||
| - name: candidate_id | ||
| description: A unique alphanumeric code assigned to a candidate | ||
| - name: person_id | ||
| description: A unique alphanumeric code assigned to a person | ||
| - name: first_name | ||
| - name: last_name | ||
| - name: middle_name | ||
| - name: maiden_name | ||
| - name: generation_code_suffix | ||
| - name: personal_title_prefix | ||
| - name: preferred_first_name | ||
| - name: preferred_last_name | ||
| - name: birth_city | ||
| - name: birth_date | ||
| - name: birth_international_province | ||
| - name: date_entered_us | ||
| - name: displacement_status | ||
| - name: is_economic_disadvantaged | ||
| - name: is_first_generation_student | ||
| - name: has_hispanic_latino_ethnicity | ||
| - name: is_multiple_birth | ||
| - name: gender | ||
| - name: sex | ||
| - name: birth_sex | ||
| - name: birth_state | ||
| - name: birth_country | ||
| description: xxxx | ||
| - name: english_language_exam | ||
| description: "Indicates that a person passed, failed, or did not take an English Language assessment (e.g., TOEFFL)." | ||
| - name: lep_code | ||
| description: "An indication that the student has been identified as limited English proficient by the Language Proficiency Assessment Committee (LPAC), or English proficient." | ||
| - name: v_addresses | ||
| description: The set of elements that describes an address, including the street address, city, state, and ZIP code. | ||
| - name: v_disabilities | ||
| description: "The disability condition(s) that best describes an individual's impairment." | ||
| - name: v_emails | ||
| description: The numbers, letters, and symbols used to identify an electronic mail (e-mail) user within the network to which the individual or organization belongs. | ||
| - name: v_languages | ||
| description: "The language(s) the individual uses to communicate" | ||
| - name: v_other_names | ||
| description: "Other names (e.g., alias, nickname, previous legal name) associated with a person." | ||
| - name: v_personal_identification_documents | ||
| description: Describes the documentation of citizenship. | ||
| - name: v_races | ||
| description: "The general racial category which most clearly reflects the individual's recognition of his or her community or with which the individual most identifies. The data model allows for multiple entries so that each individual can specify all appropriate races." | ||
| - name: v_telephones | ||
| description: "The 10-digit telephone number, including the area code, for the person." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| {{ | ||
| config( | ||
| post_hook=[ | ||
| "alter table {{ this }} add primary key (k_performance_evaluation)" | ||
| ] | ||
| ) | ||
| }} | ||
|
|
||
| with stg_performance_evaluations as ( | ||
| select * from {{ ref('stg_tpdm__performance_evaluations') }} | ||
| ), | ||
|
|
||
| stg_performance_evaluation_ratings as ( | ||
| select * from {{ ref('stg_tpdm__performance_evaluation_ratings') }} | ||
| ), | ||
|
|
||
| formatted as ( | ||
| select | ||
| stg_performance_evaluations.k_performance_evaluation, | ||
| stg_performance_evaluations.ed_org_id, | ||
| stg_performance_evaluations.performance_evaluation_title, | ||
| stg_performance_evaluations.performance_evaluation_type, | ||
| stg_performance_evaluations.school_year, | ||
| stg_performance_evaluations.academic_term, | ||
| stg_performance_evaluations.performance_evaluation_description, | ||
| stg_performance_evaluations.academic_subject, | ||
| stg_performance_evaluations.v_grade_levels, | ||
| stg_performance_evaluations.v_rating_levels | ||
| from stg_performance_evaluations | ||
| join stg_performance_evaluation_ratings | ||
| on stg_performance_evaluations.k_performance_evaluation = stg_performance_evaluation_ratings.k_performance_evaluation | ||
| ) | ||
| select * from formatted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| version: 2 | ||
|
|
||
| models: | ||
| - name: dim_performance_evaluation | ||
| description: > | ||
| ##### Overview: | ||
| Defines a performance evaluation of an educator. | ||
|
|
||
| ##### Primary Key: | ||
| `k_performance_evaluation` - There is one record per performance evaluation | ||
| config: | ||
| tags: ['tpdm'] | ||
| columns: | ||
| - name: k_performance_evaluation | ||
| description: Generated surrogate key from [tenant_code, api_year, ed_org_id, evaluation_period, performance_evaluation_title, performance_evaluation_type, school_year, academic_term] | ||
| tests: | ||
| - unique | ||
| - name: ed_org_id | ||
| description: The identifier assigned to an education organization. | ||
| - name: performance_evaluation_title | ||
| description: An assigned unique identifier for the performance evaluation. | ||
| - name: performance_evaluation_type | ||
| description: "The type (e.g., walkthrough, summative) of performance evaluation conducted." | ||
| - name: school_year | ||
| description: The identifier for the school year. | ||
| - name: academic_term | ||
| description: The term for the session during the school year. | ||
| - name: performance_evaluation_description | ||
| description: The long description of the Performance Evaluation. | ||
| - name: academic_subject | ||
| description: The description of the content or subject area of a performance evaluation. | ||
| - name: v_grade_levels | ||
| description: The grade levels involved with the performance evaluation. | ||
| - name: v_rating_levels | ||
| description: "The descriptive level(s) of ratings (cut scores) for the evaluation." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| {{ | ||
| config( | ||
| post_hook=[ | ||
| "alter table {{ this }} add primary key (k_candidate, k_performance_evaluation, k_person)", | ||
| "alter table {{ this }} add constraint fk_{{ this.name }}_candidate foreign key (k_candidate) references {{ ref('dim_candidate') }}", | ||
| "alter table {{ this }} add constraint fk_{{ this.name }}_person foreign key (k_person) references {{ ref('dim_candidate') }}", | ||
| "alter table {{ this }} add constraint fk_{{ this.name }}_performance_evaluation foreign key (k_performance_evaluation) references {{ ref('dim_performance_evaluation') }}", | ||
| ] | ||
| ) | ||
| }} | ||
|
|
||
| with stg_performance_evaluation_ratings as ( | ||
| select * from {{ ref('stg_tpdm__performance_evaluation_ratings') }} | ||
| ), | ||
|
|
||
| dim_candidate as ( | ||
| select * from {{ ref('dim_candidate') }} | ||
| ), | ||
|
|
||
| dim_performance_evaluation as ( | ||
| select * from {{ ref('dim_performance_evaluation') }} | ||
| ), | ||
|
|
||
| formatted as ( | ||
| select | ||
| dim_candidate.k_candidate, | ||
| dim_candidate.k_person, | ||
| dim_performance_evaluation.k_performance_evaluation, | ||
| stg_performance_evaluation_ratings.results as rating_results, | ||
| stg_performance_evaluation_ratings.performance_evaluation_rating_level as rating_level, | ||
| stg_performance_evaluation_ratings.reviewers, | ||
| stg_performance_evaluation_ratings.coteaching_style_observed, | ||
| stg_performance_evaluation_ratings.comments, | ||
| stg_performance_evaluation_ratings.is_announced, | ||
| stg_performance_evaluation_ratings.schedule_date, | ||
| stg_performance_evaluation_ratings.actual_date, | ||
| stg_performance_evaluation_ratings.actual_duration, | ||
| from stg_performance_evaluation_ratings | ||
| join dim_candidate | ||
| on stg_performance_evaluation_ratings.k_person = dim_candidate.k_person | ||
| join dim_performance_evaluation | ||
| on stg_performance_evaluation_ratings.k_performance_evaluation = dim_performance_evaluation.k_performance_evaluation | ||
| ) | ||
| select * from formatted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| version: 2 | ||
|
|
||
| models: | ||
| - name: fct_candidate assessment | ||
| description: > | ||
| ##### Overview: | ||
| Defines a performance-based assessment of an educator candidate | ||
|
|
||
| ##### Primary Key: | ||
| `k_candidate`, `k_performance_evaluation`, and `k_person` - There is one record per performance evaluation for a given candidate, who is a type of person | ||
| config: | ||
| tags: ['tpdm'] | ||
| columns: | ||
| - name: k_candidate | ||
| description: Foreign key to dim_candidate, generated from `tenant_code`, `api_year`, and `candidate_id` | ||
| - name: k_person | ||
| description: "Generated surrogate key from `tenant_code`, `api_year`, `person_id`, and `source_system`" | ||
| - name: k_performance_evaluation | ||
| description: Foreign key to dim_performance_evaluation, generated from [tenant_code, api_year, ed_org_id, evaluation_period, performance_evaluation_title, performance_evaluation_type, school_year, academic_term] | ||
| - name: rating_results | ||
| description: The numerical summary rating or score for the performance evaluation. | ||
| - name: rating_level | ||
| description: The rating level achieved based upon the rating or score. | ||
| - name: reviewers | ||
| description: The person(s) that conducted the performance evaluation. | ||
| - name: coteaching_style_observed | ||
| description: A type of co-teaching observed as part of the performance evaluation. | ||
| - name: comments | ||
| description: Any comments about the performance evaluation to be captured. | ||
| - name: is_announced | ||
| description: An indicator of whether the performance evaluation was announced or not. | ||
| - name: schedule_date | ||
| description: The month, day, and year on which the performance evaluation was to be conducted. | ||
| - name: actual_date | ||
| description: The month, day, and year on which the performance evaluation was conducted. | ||
| - name: actual_duration | ||
| description: The actual or estimated number of clock minutes during which the performance evaluation was conducted. | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the pros/cons to having a
fct_candidate_assessmentvs. a more genericfct_performance_evaluation_ratingsthat could be linked to any kind ofperson?