Skip to content

Commit aad2a1e

Browse files
author
Vasili Zakharko
committed
feature: create base tpdm/edfi_3 models iteration 2
1 parent 8af9a5c commit aad2a1e

17 files changed

Lines changed: 486 additions & 10 deletions

models/staging/edfi_3/base/_edfi_3__base.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,21 @@ models:
7979
- name: base_ef3__parents
8080
config:
8181
tags: ['core']
82+
- name: base_ef3__performance_evaluation_ratings
83+
config:
84+
tags: ['core ???']
85+
- name: base_ef3__performance_evaluations
86+
config:
87+
tags: ['core ???']
88+
- name: base_ef3__persons
89+
config:
90+
tags: ['core']
8291
- name: base_ef3__programs
8392
config:
8493
tags: ['core']
94+
- name: base_ef3__rubric_dimensions
95+
config:
96+
tags: ['core']
8597
- name: base_ef3__schools
8698
config:
8799
tags: ['core']
@@ -194,6 +206,9 @@ models:
194206
- name: base_ef3__survey_sections
195207
config:
196208
tags: ['survey']
209+
- name: base_ef3__survey_section_aggregate_responses
210+
config:
211+
tags: ['survey']
197212
- name: base_ef3__survey_section_responses
198213
config:
199214
tags: ['survey']
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
with performance_evaluation_ratings as (
2+
{{ source_edfi3('performance_evaluation_ratings') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
filename,
11+
file_row_number,
12+
is_deleted,
13+
??
14+
from performance_evaluation_ratings
15+
)
16+
select * from renamed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
with performance_evaluations as (
2+
{{ source_edfi3('performance_evaluations') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
filename,
11+
file_row_number,
12+
is_deleted,
13+
??
14+
from performance_evaluations
15+
)
16+
select * from renamed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
with persons as (
2+
{{ source_edfi3('persons') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
filename,
11+
file_row_number,
12+
is_deleted,
13+
???
14+
from persons
15+
)
16+
select * from renamed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
with rubric_dimensions as (
2+
{{ source_edfi3('rubric_dimensions') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
filename,
11+
file_row_number,
12+
is_deleted,
13+
???
14+
from rubric_dimensions
15+
)
16+
select * from renamed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
with survey_section_aggregate_responses as (
2+
{{ source_edfi3('survey_section_aggregate_responses') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
file_row_number,
11+
filename,
12+
is_deleted,
13+
??
14+
from survey_section_aggregate_responses
15+
)
16+
select * from renamed

models/staging/tpdm/base/_tpdm__base.yml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,69 @@ models:
77
- name: base_tpdm__educator_preparation_programs
88
config:
99
tags: ['tpdm']
10-
- name: base_tpdm__survey_response_person_target_associations
11-
config:
12-
tags: ['tpdm']
1310
- name: base_tpdm__candidate_educator_preparation_program_associations
1411
config:
1512
tags: ['tpdm']
1613
- name: base_tpdm__financial_aids
1714
config:
1815
tags: ['tpdm']
19-
- name: base_tpdm__rubric_dimensions
16+
- name: base_tpdm__evaluations
2017
config:
2118
tags: ['tpdm']
22-
- name: base_tpdm__evaluations
19+
- name: base_tpdm__evaluation_elements
20+
config:
21+
tags: ['tpdm']
22+
- name: base_tpdm__evaluation_element_ratings
2323
config:
2424
tags: ['tpdm']
2525
- name: base_tpdm__evaluation_ratings
2626
config:
2727
tags: ['tpdm']
28-
- name: base_tpdm__performance_evaluations
28+
- name: base_tpdm__evaluation_objectives
29+
config:
30+
tags: ['tpdm']
31+
- name: base_tpdm__evaluation_objective_ratings
2932
config:
3033
tags: ['tpdm']
3134
- name: base_tpdm__performance_evaluation_ratings
3235
config:
3336
tags: ['tpdm']
34-
- name: base_tpdm__evaluation_objectives
37+
- name: base_tpdm__performance_evaluations
3538
config:
3639
tags: ['tpdm']
37-
- name: base_tpdm__evaluation_objective_ratings
40+
- name: base_tpdm__persons
3841
config:
3942
tags: ['tpdm']
40-
- name: base_tpdm__evaluation_elements
43+
- name: base_tpdm__post_secondary_institutions
4144
config:
4245
tags: ['tpdm']
43-
- name: base_tpdm__evaluation_element_ratings
46+
- name: base_tpdm__rubric_dimensions
47+
config:
48+
tags: ['tpdm']
49+
- name: base_tpdm__schools
50+
config:
51+
tags: ['tpdm']
52+
- name: base_tpdm__sections
53+
config:
54+
tags: ['tpdm']
55+
- name: base_tpdm__student_academic_records
56+
config:
57+
tags: ['tpdm']
58+
- name: base_tpdm__students
59+
config:
60+
tags: ['tpdm']
61+
- name: base_tpdm__survey_response_person_target_associations
62+
config:
63+
tags: ['tpdm']
64+
- name: base_tpdm__survey_responses
65+
config:
66+
tags: ['tpdm']
67+
- name: base_tpdm__survey_section_aggregate_responses
68+
config:
69+
tags: ['tpdm']
70+
- name: base_tpdm__survey_section_responses
71+
config:
72+
tags: ['tpdm']
73+
- name: base_tpdm__survey_sections
4474
config:
4575
tags: ['tpdm']
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
with persons as (
2+
{{ source_edfi3('persons') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
filename,
11+
file_row_number,
12+
is_deleted,
13+
???
14+
from persons
15+
)
16+
select * from renamed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
with post_secondary_institutions as (
2+
{{ source_edfi3('post_secondary_institutions') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
file_row_number,
11+
filename,
12+
is_deleted,
13+
14+
v:id::string as record_guid,
15+
v:postSecondaryInstitutionId::int as post_secondary_institution_id,
16+
v:nameOfInstitution::string as name_of_institution,
17+
v:shortNameOfInstitution::string as short_name_of_institution,
18+
v:webSite::string as web_site,
19+
-- descriptors
20+
{{ extract_descriptor('v:postSecondaryInstitutionLevelDescriptor::string')}} as post_secondary_institution_level,
21+
{{ extract_descriptor('v:administrativeFundingControlDescriptor::string')}} as administrative_funding_control,
22+
{{ extract_descriptor('v:federalLocaleCodeDescriptor::string')}} as federal_locale_code,
23+
{{ extract_descriptor('v:operationalStatusDescriptor::string')}} as operational_status_descriptor,
24+
-- unflattened lists
25+
v:categories as v_categories,
26+
v:addresses as v_addresses,
27+
v:identificationCodes as v_identification_codes,
28+
v:indicators as v_indicators,
29+
v:institutionTelephones as v_institution_telephones,
30+
v:internationalAddresses as v_international_addresses,
31+
v:mediumOfInstructions as v_medium_of_instructions
32+
from post_secondary_institutions
33+
)
34+
select * from renamed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
with schools as (
2+
{{ source_edfi3('schools') }}
3+
),
4+
renamed as (
5+
select
6+
tenant_code,
7+
api_year,
8+
pull_timestamp,
9+
last_modified_timestamp,
10+
file_row_number,
11+
filename,
12+
is_deleted,
13+
v:id::string as record_guid,
14+
v:schoolId::integer as school_id,
15+
v:nameOfInstitution::string as school_name,
16+
v:shortNameOfInstitution::string as school_short_name,
17+
v:webSite::string as website,
18+
v:localEducationAgencyReference:localEducationAgencyId as lea_id,
19+
-- pull out school categories
20+
case
21+
when array_size(v:schoolCategories) = 1
22+
then {{ extract_descriptor('v:schoolCategories[0]:schoolCategoryDescriptor::string') }}
23+
when array_size(v:schoolCategories) > 1
24+
then 'Multiple Categories'
25+
else NULL
26+
end as school_category,
27+
-- descriptors
28+
{{ extract_descriptor('v:schoolTypeDescriptor::string') }} as school_type,
29+
{{ extract_descriptor('v:operationalStatusDescriptor::string') }} as operational_status,
30+
{{ extract_descriptor('v:administrativeFundingControlDescriptor::string') }} as administrative_funding_control,
31+
{{ extract_descriptor('v:internetAccessDescriptor::string') }} as internet_access,
32+
{{ extract_descriptor('v:titleIPartASchoolDesignationDescriptor::string') }} as title_i_part_a_school_designation,
33+
{{ extract_descriptor('v:charterStatusDescriptor::string') }} as charter_status,
34+
{{ extract_descriptor('v:charterApprovalAgencyTypeDescriptor::string') }} as charter_approval_agency,
35+
{{ extract_descriptor('v:magnetSpecialProgramEmphasisSchoolDescriptor::string') }} as magnet_type,
36+
-- references
37+
v:localEducationAgencyReference as local_education_agency_reference,
38+
-- unflattened lists
39+
v:addresses as v_addresses,
40+
v:educationOrganizationCategories as v_education_organization_categories,
41+
v:gradeLevels as v_grade_levels,
42+
v:identificationCodes as v_identification_codes,
43+
v:indicators as v_indicators,
44+
v:institutionTelephones as v_institution_telephones,
45+
v:internationalAddresses as v_international_addresses,
46+
v:schoolCategories as v_school_categories,
47+
48+
-- edfi extensions
49+
v:_ext as v_ext
50+
from schools
51+
)
52+
select * from renamed

0 commit comments

Comments
 (0)