Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2f483db
Create base and stage models for tpdm survey_section_response_person_…
oscarrezab Jun 30, 2025
0d53c52
Modify attribute order in base model and add relevant key to the gen_…
oscarrezab Jul 3, 2025
31cad93
Create base/stg models for application_events
oscarrezab Jul 11, 2025
72b398f
Update naming in staging models
oscarrezab Jul 15, 2025
78a2569
Fix gen_skey column naming
oscarrezab Jul 15, 2025
9006460
Fix dtype for date in base model
oscarrezab Jul 15, 2025
78fc5da
Fix stage model for application_events
oscarrezab Jul 16, 2025
eade733
Base/stg models for StaffEducatorPreparationProgramAssociation
oscarrezab Jul 16, 2025
6f0f87d
Base/stg models for CredentialEvent
oscarrezab Jul 16, 2025
8f03b6c
Base/stg models for FieldworkExperienceSectionAssociation
oscarrezab Jul 16, 2025
e0f7b0b
Base/stg models for Goal
oscarrezab Jul 16, 2025
75cf15d
Fix k_goal in stg model
oscarrezab Jul 17, 2025
c1d5324
Create base/stg models for OpenStaffPositionEvent
oscarrezab Jul 17, 2025
e26e8a4
Create base/stg models for ProfessionalDevelopmentEvent
oscarrezab Jul 17, 2025
db61ff6
Fix base model
oscarrezab Jul 17, 2025
576f6c5
Create base/stg models for ProfessionalDevelopmentEventAttendance
oscarrezab Jul 17, 2025
b1721eb
Fix date dtype
oscarrezab Jul 17, 2025
44f73d6
Create base/stg models for SurveySectionAggregateResponse
oscarrezab Jul 17, 2025
09c3960
Fix base/stg models
oscarrezab Jul 17, 2025
e7f069f
Create base/stg models for QuantitativeMeasure
oscarrezab Jul 18, 2025
a1700fb
Create base/stg models for QuantitativeMeasureScore
oscarrezab Jul 18, 2025
03f9475
Create base/stg models for RecruitmentEvent
oscarrezab Jul 18, 2025
8a9e0b8
Create base/stg models for RecruitmentEventAttendance
oscarrezab Jul 18, 2025
c622cbc
Fix model filenames
oscarrezab Jul 18, 2025
0282347
Fix surrogate key for ed_org in stage model
oscarrezab Jul 18, 2025
e7afdab
Create base/stg models for Path
oscarrezab Jul 18, 2025
97e42f4
Create base/stg models for PathMilestone
oscarrezab Jul 19, 2025
77c8f66
Create base/stg models for PathPhase
oscarrezab Jul 19, 2025
be737f5
Create base/stg models for StudentPath
oscarrezab Jul 19, 2025
da73bb3
Fix models for StudentPath
oscarrezab Jul 19, 2025
7b9dd8e
Base/stg models for SudentPathMilestone
oscarrezab Jul 19, 2025
4cd694e
Fix structure in base model
oscarrezab Jul 19, 2025
fba9700
Create base/stg models for StudentPathPhaseStatus
oscarrezab Jul 19, 2025
bc77faa
Reorder and rename attributes in base model
oscarrezab Aug 5, 2025
e86d784
Fix column name in gen_skey
oscarrezab Aug 5, 2025
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
95 changes: 93 additions & 2 deletions macros/gen_skey.sql
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@

'k_survey_section': {
'reference_name': 'survey_section_reference',
'col_list': ['namespace', 'surveyIdentifier', 'survey_section_title'],
'col_list': ['namespace', 'surveyIdentifier', 'surveySectionTitle'],
'annualize': True
},

Expand Down Expand Up @@ -342,7 +342,98 @@
'col_list': [],
'annualize': False
},

'k_survey_section_response': {
'reference_name': 'survey_section_response_reference',
'col_list': ['surveyIdentifier', 'namespace', 'surveySectionTitle'],
'annualize': True
},
'k_application': {
'reference_name': 'application_reference',
'col_list': ['applicantProfileIdentifier', 'applicationIdentifier', 'educationOrganizationId'],
'annualize': True
},
'k_credential': {
'reference_name': 'credential_reference',
'col_list': ['credentialIdentifier', 'stateOfIssueStateAbbreviationDescriptor'],
'annualize': True
},
'k_fieldwork_experience': {
'reference_name': 'fieldwork_experience_reference',
'col_list': ['beginDate', 'fieldworkIdentifier', 'studentUniqueId'],
'annualize': True
},
'k_section': {
'reference_name': 'section_reference',
'col_list': ['localCourseCode', 'schoolId', 'schoolYear', 'sectionIdentifier', 'sessionName'],
'annualize': False
},
'k_open_staff_position': {
'reference_name': 'open_staff_position_reference',
'col_list': ['educationOrganizationId', 'eventDate', 'openStaffPositionEventTypeDescriptor', 'requisitionNumber'],
'annualize': True
},
'k_professional_development_event': {
'reference_name': 'professional_development_event_reference',
'col_list': ['namespace', 'professionalDevelopmentTitle'],
'annualize': True
},
'k_evaluation_element_rating': {
'reference_name': 'evaluation_element_rating_reference',
'col_list': ['educationOrganizationId',
'evaluationDate',
'evaluationElementTitle',
'evaluationObjectiveTitle',
'evaluationPeriodDescriptor',
'evaluationTitle',
'performanceEvaluationTitle',
'performanceEvaluationTypeDescriptor',
'personId',
'schoolYear',
'sourceSystemDescriptor',
'termDescriptor'],
'annualize': True
},
'k_quantitative_measure': {
'reference_name': 'quantitative_measure_reference',
'col_list': [
'educationOrganizationId',
'evaluationElementTitle',
'evaluationObjectiveTitle',
'evaluationPeriodDescriptor',
'evaluationTitle',
'performanceEvaluationTitle',
'performanceEvaluationTypeDescriptor',
'quantitative_measure_identifier',
'schoolYear',
'termDescriptor'
],
'annualize': True
},
'k_recruitment_event': {
'reference_name': 'recruitment_event_reference',
'col_list': ['educationOrganizationId', 'eventDate', 'eventTitle'],
'annualize': True
},
'k_path': {
'reference_name': 'path_reference',
'col_list': ['educationOrganizationId', 'pathName'],
'annualize': True
},
'k_student_path': {
'reference_name': 'student_path_reference',
'col_list': ['educationOrganizationId', 'pathName', 'studentUniqueId'],
'annualize': True
},
'k_path_milestone': {
'reference_name': 'path_milestone_reference',
'col_list': ['educationOrganizationId', 'pathMilestoneName', 'pathMilestoneTypeDescriptor', 'pathName'],
'annualize': True
},
'k_path_phase': {
'reference_name': 'path_phase_reference',
'col_list': ['educationOrganizationId', 'pathName', 'pathPhaseName'],
'annualize': True
}
}
%}
{#- retrieve key def for then decompose parts -#}
Expand Down
4 changes: 4 additions & 0 deletions models/staging/tpdm/base/_tpdm__base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@ models:
tags: ['tpdm']
enabled: "{{ var('edu:tpdmcommunity:enabled', False) }}"

- name: base_tpdm__survey_section_response_person_target_associations
config:
tags: ['tpdm']
enabled: "{{ var('edu:tpdmcommunity:enabled', False) }}"
36 changes: 36 additions & 0 deletions models/staging/tpdm/base/base_tpdm__application_events.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
with app_events as (
{{ source_edfi3('application_events') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
-- identity components
v:sequenceNumber::int as sequence_number,
v:eventDate::date as event_date, -- this could also be event_start_date
{{ extract_descriptor('v:applicationEventTypeDescriptor::string') }} as application_event_type,
v:applicationReference:applicationIdentifier::string as application_identifier,
v:applicationReference:applicantProfileIdentifier::string as applicant_profile_identifier,
v:applicationReference:educationOrganizationId::int as ed_org_id,
-- non-identity components
v:eventEndDate::date as event_end_date
v:applicationEvaluationScore::float as application_evaluation_score
v:schoolYearTypeReference:schoolYear:int as school_year
-- references
v:applicationReference as application_reference
-- descriptors
{{ extract_descriptor('v:applicationEventResultDescriptor::string') }} as application_event_result_descriptor
{{ extract_descriptor('v:termDescriptor::string') }} as academic_term
-- edfi extensions
v:_ext as v_ext

from app_events
)
select * from renamed
29 changes: 29 additions & 0 deletions models/staging/tpdm/base/base_tpdm__credential_events.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
with app_events as (
{{ source_edfi3('application_events') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
-- identity components
v:credentialEventDate::date as credential_event_date,
{{ extract_descriptor('v:credentialEventTypeDescriptor::string') }} as credential_event_type,
v:credentialReference:credentialIdentifier::string as credential_identifier,
{{ extract_descriptor('v:credentialReference:stateOfIssueStateAbbreviationDescriptor::string') }} as state_of_issue,
-- non-identity components
v:credentialEventReason::string as credential_event_reason
-- references
v:credentialReference as credential_reference
-- edfi extensions
v:_ext as v_ext

from app_events
)
select * from renamed
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
with student_section_associations as (
{{ source_edfi3('student_section_associations') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
file_row_number,
filename,
is_deleted,

v:id::string as record_guid,
-- identity components
v:fieldworkExperienceReference:beginDate::date as begin_date,
v:fieldworkExperienceReference:fieldworkIdentifier::string as fieldwork_identifier,
v:fieldworkExperienceReference:studentUniqueId::string as student_unique_id,
v:sectionReference:sectionIdentifier::string as section_identifier,
v:sectionReference:localCourseCode::string as local_course_code,
v:sectionReference:sessionName::string as session_name,
v:sectionReference:schoolId::int as school_id,
v:sectionReference:schoolYear::int as school_year,
-- references
v:fieldworkExperienceReference as fieldwork_experience_reference,
v:sectionReference as section_reference,
-- edfi extensions
v:_ext as v_ext
from student_section_associations
)
select * from renamed
37 changes: 37 additions & 0 deletions models/staging/tpdm/base/base_tpdm__goals.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
with base_goals as (
select * from {{ source_edfi3('goals') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
-- identity components
v:personReference:personId::string as person_id,
v:personReference:sourceSystemDescriptor::string as person_source_system,
v:goalTitle::string as goal_title,
v:assignmentDate::date as assignment_date,
-- non-identity components
v:goalDescription::string as goal_description,
v:comments::string as comments,
v:completed_indicator::boolean as is_completed,
v:completedDate::date as completed_date,
v:dueDate::date as due_date,
-- descriptors
{{ extract_descriptor('v:goalTypeDescriptor::string') }} as goal_type,
-- references
v:evaluationElementReference as evaluation_element_reference,
v:evaluationObjectiveReference as evaluation_objective_reference,
v:parentGoalReference as parent_goal_reference,
v:personReference as person_reference,
-- edfi extensions
v:_ext as v_ext
from base_goals
)
select * from renamed
29 changes: 29 additions & 0 deletions models/staging/tpdm/base/base_tpdm__open_staff_position_events.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
with open_staff_position_events as (
{{ source_edfi3('open_staff_position_events') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
-- identity components
v:eventDate::date as event_date,
{{ extract_descriptor('v:openStaffPositionEventTypeDescriptor::string') }} as open_staff_position_event_type, -- name event_type instead?
v:openStaffPositionReference:educationOrganizationId::int as ed_org_id,
v:openStaffPositionReference:requisitionNumber::string as requisition_number,
-- descriptors
{{ extract_descriptor('v:openStaffPositionEventStatusDescriptor::string') }} as open_staff_position_event_status, -- name event_status instead?
-- references
v:openStaffPositionReference as open_staff_position_reference,
-- edfi extensions
v:_ext as v_ext

from open_staff_position_events
)
select * from renamed
26 changes: 26 additions & 0 deletions models/staging/tpdm/base/base_tpdm__path_milestones.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
with path_milestones as (
{{ source_edfi3('path_milestones') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
-- identity components
v:pathMilestoneName::string as path_milestone_name,
{{ extract_descriptor('v:pathMilestoneTypeDescriptor::string') }} as path_milestone_type,
-- non-identity components
v:pathMilestoneCode::string as path_milestone_code,
v:pathMilestoneDescription::string as path_milestone_description,
-- edfi extensions
v:_ext as v_ext

from path_milestones
)
select * from renamed
31 changes: 31 additions & 0 deletions models/staging/tpdm/base/base_tpdm__path_phases.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
with path_phases as (
{{ source_edfi3('path_phases') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
-- identity components
v:pathPhaseName::string as path_phase_name,
v:pathReference:educationOrganizationId::int as ed_org_id,
v:pathReference:pathName::string as path_name,
-- non-identity components
v:pathPhaseSequence::int as path_phase_sequence,
v:phasePathDescription::string as phase_path_description,
-- unflattened lists
v:pathMilestones as v_path_milestones,
-- references
v:pathReference as path_reference,
-- edfi extensions
v:_ext as v_ext

from path_phases
)
select * from renamed
30 changes: 30 additions & 0 deletions models/staging/tpdm/base/base_tpdm__paths.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
with paths as (
{{ source_edfi3('paths') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
-- identity components
v:pathName::string as path_name,
v:educationOrganizationReference:educationOrganizationId::int as ed_org_id,
-- non-identity components
v:graduationPlanReference:educationOrganizationId::int as graduation_plan_ed_org_id,
{{ extract_descriptor('v:graduationPlanReference:graduationPlanTypeDescriptor::string') }} as graduation_plan_type,
v:graduationPlanReference:graduationSchoolYear::int as graduation_school_year,
-- references
v:educationOrganizationReference as education_organization_reference,
v:graduationPlanReference as graduation_plan_reference,
-- edfi extensions
v:_ext as v_ext

from paths
)
select * from renamed
Loading