Skip to content
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

Feature/create base tpdm models full step2 #14

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
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
81 changes: 81 additions & 0 deletions models/staging/edfi_3/base/_edfi_3__base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,57 @@ models:
- name: base_ef3__parents
config:
tags: ['core']
- name: base_ef3__performance_evaluation_ratings
config:
tags: ['core ???']
- name: base_ef3__performance_evaluations
config:
tags: ['core ???']
- name: base_ef3__persons
config:
tags: ['core']
- name: base_ef3__programs
config:
tags: ['core']
- name: base_ef3__school_year_types
config:
tags: ['core']
- name: base_ef3__schools
config:
tags: ['core']
- name: base_ef3__section_attendance_taken_events
config:
tags: ['core']
- name: base_ef3__sections
config:
tags: ['core']
- name: base_ef3__sessions
config:
tags: ['core']
- name: base_ef3__staff_absence_events
config:
tags: ['core']
- name: base_ef3__staff_cohort_associations
config:
tags: ['core']
- name: base_ef3__staff_discipline_incident_associations
config:
tags: ['core']
- name: base_ef3__staff_education_organization_assignment_associations
config:
tags: ['core']
- name: base_ef3__staff_education_organization_contact_associations
config:
tags: ['core']
- name: base_ef3__staff_education_organization_employment_associations
config:
tags: ['core']
- name: base_ef3__staff_leaves
config:
tags: ['core']
- name: base_ef3__staff_program_associations
config:
tags: ['core']
- name: base_ef3__staff_school_associations
config:
tags: ['core']
Expand All @@ -117,6 +150,12 @@ models:
config:
tags: ['cohort']
enabled: "{{ var('src:domain:cohort:enabled', True) }}"
- name: base_ef3__student_competency_objectives
config:
tags: ['base']
- name: base_ef3__student_cte_program_associations
config:
tags: ['base']
- name: base_ef3__student_discipline_incident_associations
config:
tags: ['discipline']
Expand All @@ -132,26 +171,50 @@ models:
- name: base_ef3__student_education_organization_associations
config:
tags: ['core']
- name: base_ef3__student_education_organization_responsibility_associations
config:
tags: ['core']
- name: base_ef3__student_gradebook_entries
config:
tags: ['core']
- name: base_ef3__student_homeless_program_associations
config:
tags: ['homeless']
enabled: "{{ var('src:program:homeless:enabled', True) }}"
- name: base_ef3__student_intervention_associations
config:
tags: ['core']
- name: base_ef3__student_intervention_attendance_events
config:
tags: ['core']
- name: base_ef3__student_language_instruction_program_associations
config:
tags: ['language_instruction']
enabled: "{{ var('src:program:language_instruction:enabled', True) }}"
- name: base_ef3__student_migrant_education_program_associations
config:
tags: ['core']
- name: base_ef3__student_neglected_or_delinquent_program_associations
config:
tags: ['core']
- name: base_ef3__student_parent_associations
config:
tags: ['core']
- name: base_ef3__student_program_associations
config:
tags: ['core']
- name: base_ef3__student_program_attendance_events
config:
tags: ['core']
- name: base_ef3__student_school_associations
config:
tags: ['core']
- name: base_ef3__student_school_attendance_events
config:
tags: ['core']
- name: base_ef3__student_school_food_service_program_associations
config:
tags: ['core']
- name: base_ef3__student_section_associations
config:
tags: ['core']
Expand All @@ -169,6 +232,12 @@ models:
- name: base_ef3__students
config:
tags: ['core']
- name: base_ef3__survey_course_associations
config:
tags: ['survey']
- name: base_ef3__survey_program_associations
config:
tags: ['survey']
- name: base_ef3__survey_question_responses
config:
tags: ['survey']
Expand All @@ -194,6 +263,18 @@ models:
- name: base_ef3__survey_sections
config:
tags: ['survey']
- name: base_ef3__survey_section_aggregate_responses
config:
tags: ['survey']
- name: base_ef3__survey_section_associations
config:
tags: ['survey']
- name: base_ef3__survey_section_response_education_organization_target_associations
config:
tags: ['survey']
- name: base_ef3__survey_section_response_staff_target_associations
config:
tags: ['survey']
- name: base_ef3__survey_section_responses
config:
tags: ['survey']
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
with performance_evaluation_ratings as (
{{ source_edfi3('performance_evaluation_ratings') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,
??
from performance_evaluation_ratings
)
select * from renamed
16 changes: 16 additions & 0 deletions models/staging/edfi_3/base/base_ef3__performance_evaluations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
with performance_evaluations as (
{{ source_edfi3('performance_evaluations') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,
??
from performance_evaluations
)
select * from renamed
21 changes: 21 additions & 0 deletions models/staging/edfi_3/base/base_ef3__school_year_types.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
with school_year_types as (
{{ source_edfi3('school_year_types') }}
),
renamed as (
select
tenant_code,
api_year,
pull_timestamp,
last_modified_timestamp,
filename,
file_row_number,
is_deleted,

v:id::string as record_guid,
v:schoolYear::string as school_year,
v:currentSchoolYear::string as current_school_year,
v:schoolYearDescription::string as school_year_description

from school_year_types
)
select * from renamed
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
with section_attendance_taken_events as (
{{ source_edfi3('section_attendance_taken_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,
-- fields
v:eventDate::string as event_date,
-- calendar date key
v:calendarDateReference:calendarCode::string as calendar_date_local_course_code,
v:calendarDateReference:date::date as calendar_date_date,
v:calendarDateReference:schoolId::int as calendar_date_school_id,
v:calendarDateReference:schoolYear::int as calendar_date_school_year,
-- section key
v:sectionReference:localCourseCode::string as local_course_code,
v:sectionReference:schoolId::int as school_id,
v:sectionReference:schoolYear::int as school_year,
v:sectionReference:sectionIdentifier::string as section_id,
v:sectionReference:sessionName::string as session_name,
-- staff key
v:staffReference:staffUniqueId::string as staff_unique_id,
-- references
v:calendarDateReference as calendar_date_reference,
v:sectionReference as section_reference,
v:staffReference as staff_reference

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

v:id::string as record_guid,
v:eventDate::date as event_date,
v:absenceEventReason::string as absence_event_reason,
v:hoursAbsent::integer as hours_absent,
v:staffReference:staffUniqueId::integer as staff_unique_id,
-- descriptors
{{ extract_descriptor('v:absenceEventCategoryDescriptor::string') }} as absence_event_category,
-- references
v:staffReference as school_reference

from staff_absence_events
)
select * from renamed
27 changes: 27 additions & 0 deletions models/staging/edfi_3/base/base_ef3__staff_cohort_associations.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
with staff_cohort_associations as (
{{ source_edfi3('staff_cohort_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,
v:beginDate::date as begin_date,
v:endDate::date as end_date,
v:studentRecordAccess::boolean as student_record_access,
v:staffReference:staffUniqueId::integer as staff_unique_id,
v:cohortReference:cohortIdentifier::string as cohort_dentifier,
v:cohortReference:educationOrganizationId::integer as education_organization_id,
-- references
v:cohortReference as cohort_reference,
v:staffReference as staff_reference

from staff_cohort_associations
)
select * from renamed
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
with staff_discipline_incident_associations as (
{{ source_edfi3('staff_discipline_incident_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,
v:disciplineIncidentParticipationCodes:disciplineIncidentParticipationCodeDescriptor::string as discipline_incident_participation_code_descriptor,
v:staffReference:staffUniqueId::integer as staff_unique_id,
v:disciplineIncidentReference:incidentIdentifier::string as incident_identifier,
v:disciplineIncidentReference:schoolId::integer as school_id,
-- references
v:disciplineIncidentReference as discipline_incident_reference,
v:staffReference as staff_reference

from staff_discipline_incident_associations
)
select * from renamed
Loading