Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions models/tpdm_warehouse/dim_candidate.sql
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
69 changes: 69 additions & 0 deletions models/tpdm_warehouse/dim_candidate.yml
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."
33 changes: 33 additions & 0 deletions models/tpdm_warehouse/dim_performance_evaluation.sql
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
35 changes: 35 additions & 0 deletions models/tpdm_warehouse/dim_performance_evaluation.yml
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."
44 changes: 44 additions & 0 deletions models/tpdm_warehouse/fct_candidate_assessment.sql
Copy link
Copy Markdown
Collaborator

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_assessment vs. a more generic fct_performance_evaluation_ratings that could be linked to any kind of person?

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
38 changes: 38 additions & 0 deletions models/tpdm_warehouse/fct_candidate_assessment.yml
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.