forked from edanalytics/edu_edfi_source
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: create base tpdm/edfi_3 models iteration 2
- Loading branch information
Vasili Zakharko
committed
Jul 22, 2024
1 parent
8af9a5c
commit bdd6b79
Showing
17 changed files
with
486 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
16 changes: 16 additions & 0 deletions
16
models/staging/edfi_3/base/base_ef3__performance_evaluation_ratings.sql
This file contains 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,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
16
models/staging/edfi_3/base/base_ef3__performance_evaluations.sql
This file contains 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,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 |
This file contains 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,16 @@ | ||
with persons as ( | ||
{{ source_edfi3('persons') }} | ||
), | ||
renamed as ( | ||
select | ||
tenant_code, | ||
api_year, | ||
pull_timestamp, | ||
last_modified_timestamp, | ||
filename, | ||
file_row_number, | ||
is_deleted, | ||
??? | ||
from persons | ||
) | ||
select * from renamed |
16 changes: 16 additions & 0 deletions
16
models/staging/edfi_3/base/base_ef3__rubric_dimensions.sql
This file contains 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,16 @@ | ||
with rubric_dimensions as ( | ||
{{ source_edfi3('rubric_dimensions') }} | ||
), | ||
renamed as ( | ||
select | ||
tenant_code, | ||
api_year, | ||
pull_timestamp, | ||
last_modified_timestamp, | ||
filename, | ||
file_row_number, | ||
is_deleted, | ||
??? | ||
from rubric_dimensions | ||
) | ||
select * from renamed |
16 changes: 16 additions & 0 deletions
16
models/staging/edfi_3/base/base_ef3__survey_section_aggregate_responses.sql
This file contains 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,16 @@ | ||
with survey_section_aggregate_responses as ( | ||
{{ source_edfi3('survey_section_aggregate_responses') }} | ||
), | ||
renamed as ( | ||
select | ||
tenant_code, | ||
api_year, | ||
pull_timestamp, | ||
last_modified_timestamp, | ||
file_row_number, | ||
filename, | ||
is_deleted, | ||
?? | ||
from survey_section_aggregate_responses | ||
) | ||
select * from renamed |
This file contains 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
This file contains 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,16 @@ | ||
with persons as ( | ||
{{ source_edfi3('persons') }} | ||
), | ||
renamed as ( | ||
select | ||
tenant_code, | ||
api_year, | ||
pull_timestamp, | ||
last_modified_timestamp, | ||
filename, | ||
file_row_number, | ||
is_deleted, | ||
??? | ||
from persons | ||
) | ||
select * from renamed |
34 changes: 34 additions & 0 deletions
34
models/staging/tpdm/base/base_tpdm__post_secondary_institutions.sql
This file contains 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,34 @@ | ||
with post_secondary_institutions as ( | ||
{{ source_edfi3('post_secondary_institutions') }} | ||
), | ||
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:postSecondaryInstitutionId::int as post_secondary_institution_id, | ||
v:nameOfInstitution::string as name_of_institution, | ||
v:shortNameOfInstitution::string as short_name_of_institution, | ||
v:webSite::string as web_site, | ||
-- descriptors | ||
{{ extract_descriptor('v:postSecondaryInstitutionLevelDescriptor::string')}} as post_secondary_institution_level, | ||
{{ extract_descriptor('v:administrativeFundingControlDescriptor::string')}} as administrative_funding_control, | ||
{{ extract_descriptor('v:federalLocaleCodeDescriptor::string')}} as federal_locale_code, | ||
{{ extract_descriptor('v:operationalStatusDescriptor::string')}} as operational_status_descriptor, | ||
-- unflattened lists | ||
v:categories as v_categories, | ||
v:addresses as v_addresses, | ||
v:identificationCodes as v_identification_codes, | ||
v:indicators as v_indicators, | ||
v:institutionTelephones as v_institution_telephones, | ||
v:internationalAddresses as v_international_addresses, | ||
v:mediumOfInstructions as v_medium_of_instructions | ||
from post_secondary_institutions | ||
) | ||
select * from renamed |
This file contains 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,52 @@ | ||
with schools as ( | ||
{{ source_edfi3('schools') }} | ||
), | ||
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:schoolId::integer as school_id, | ||
v:nameOfInstitution::string as school_name, | ||
v:shortNameOfInstitution::string as school_short_name, | ||
v:webSite::string as website, | ||
v:localEducationAgencyReference:localEducationAgencyId as lea_id, | ||
-- pull out school categories | ||
case | ||
when array_size(v:schoolCategories) = 1 | ||
then {{ extract_descriptor('v:schoolCategories[0]:schoolCategoryDescriptor::string') }} | ||
when array_size(v:schoolCategories) > 1 | ||
then 'Multiple Categories' | ||
else NULL | ||
end as school_category, | ||
-- descriptors | ||
{{ extract_descriptor('v:schoolTypeDescriptor::string') }} as school_type, | ||
{{ extract_descriptor('v:operationalStatusDescriptor::string') }} as operational_status, | ||
{{ extract_descriptor('v:administrativeFundingControlDescriptor::string') }} as administrative_funding_control, | ||
{{ extract_descriptor('v:internetAccessDescriptor::string') }} as internet_access, | ||
{{ extract_descriptor('v:titleIPartASchoolDesignationDescriptor::string') }} as title_i_part_a_school_designation, | ||
{{ extract_descriptor('v:charterStatusDescriptor::string') }} as charter_status, | ||
{{ extract_descriptor('v:charterApprovalAgencyTypeDescriptor::string') }} as charter_approval_agency, | ||
{{ extract_descriptor('v:magnetSpecialProgramEmphasisSchoolDescriptor::string') }} as magnet_type, | ||
-- references | ||
v:localEducationAgencyReference as local_education_agency_reference, | ||
-- unflattened lists | ||
v:addresses as v_addresses, | ||
v:educationOrganizationCategories as v_education_organization_categories, | ||
v:gradeLevels as v_grade_levels, | ||
v:identificationCodes as v_identification_codes, | ||
v:indicators as v_indicators, | ||
v:institutionTelephones as v_institution_telephones, | ||
v:internationalAddresses as v_international_addresses, | ||
v:schoolCategories as v_school_categories, | ||
|
||
-- edfi extensions | ||
v:_ext as v_ext | ||
from schools | ||
) | ||
select * from renamed |
This file contains 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,52 @@ | ||
with sections as ( | ||
{{ source_edfi3('sections') }} | ||
), | ||
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:sectionIdentifier::string as section_id, | ||
v:sectionName::string as section_name, | ||
-- course offering key | ||
v:courseOfferingReference:schoolId::integer as school_id, | ||
v:courseOfferingReference:localCourseCode::string as local_course_code, | ||
v:courseOfferingReference:sessionName::string as session_name, | ||
v:courseOfferingReference:schoolYear::integer as school_year, | ||
-- location key | ||
v:locationReference:classroomIdentificationCode::string as classroom_identification_code, | ||
v:locationReference:schoolId::integer as classroom_location_school_id, | ||
-- location school key | ||
v:locationSchoolReference:schoolId::integer as school_location_school_id, | ||
-- values | ||
v:availableCreditConversion::float as available_credit_conversion, | ||
v:availableCredits::float as available_credits, | ||
v:sequenceOfCourse::integer as sequence_of_course, | ||
v:officialAttendancePeriod::boolean as is_official_attendance_period, | ||
-- descriptors | ||
{{ extract_descriptor('v:availableCreditTypeDescriptor::string') }} as available_credit_type, | ||
{{ extract_descriptor('v:educationalEnvironmentDescriptor::string') }} as educational_environment_type, | ||
{{ extract_descriptor('v:instructionLanguageDescriptor::string') }} as instruction_language, | ||
{{ extract_descriptor('v:mediumOfInstructionDescriptor::string') }} as medium_of_instruction, | ||
{{ extract_descriptor('v:populationServedDescriptor::string') }} as population_served, | ||
-- references | ||
v:courseOfferingReference as course_offering_reference, | ||
v:locationReference as location_reference, | ||
v:locationSchoolReference as location_school_reference, | ||
-- lists | ||
v:characteristics as v_section_characteristics, | ||
v:classPeriods as v_class_periods, | ||
v:courseLevelCharacteristics as v_course_level_characteristics, | ||
v:offeredGradeLevels as v_offered_grade_levels, | ||
v:programs as v_programs, | ||
|
||
-- edfi extensions | ||
v:_ext as v_ext | ||
from sections | ||
) | ||
select * from renamed |
Oops, something went wrong.