Skip to content

Commit 0de85c4

Browse files
authored
standardize ed org abbrevs (#52)
1 parent 369764b commit 0de85c4

7 files changed

+12
-17
lines changed

macros/gen_skey.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@
170170
'col_list': ['cohortIdentifier', 'educationOrganizationId'],
171171
'annualize': True
172172
},
173-
'k_education_service_center': {
174-
'reference_name': 'education_service_center_reference',
175-
'col_list': ['educationServiceCenterId'],
176-
'annualize': False
177-
},
178173
'k_survey': {
179174
'reference_name': 'survey_reference',
180175
'col_list': ['namespace', 'surveyIdentifier'],

models/staging/edfi_3/base/base_ef3__education_service_centers.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ renamed as (
1010
filename,
1111
is_deleted,
1212
v:id::string as record_guid,
13-
v:educationServiceCenterId::string as service_center_id,
14-
v:nameOfInstitution::string as service_center_name,
15-
v:shortNameOfInstitution::string as service_center_short_name,
16-
v:stateEducationAgencyReference:stateEducationAgencyId as state_education_agency_id,
13+
v:educationServiceCenterId::string as esc_id,
14+
v:nameOfInstitution::string as esc_name,
15+
v:shortNameOfInstitution::string as esc_short_name,
16+
v:stateEducationAgencyReference:stateEducationAgencyId as sea_id,
1717
v:webSite::string as website,
1818
-- descriptors
1919
{{ extract_descriptor('v:operationalStatusDescriptor::string') }} as operational_status,

models/staging/edfi_3/base/base_ef3__local_education_agencies.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ renamed as (
1616
v:webSite::string as website,
1717
-- reference ids
1818
v:parentLocalEducationAgencyReference:localEducationAgencyId::int as parent_lea_id,
19-
v:educationServiceCenterReference:educationServiceCenterId::int as education_service_center_id,
20-
v:stateEducationAgencyReference:stateEducationAgencyId::int as state_education_agency_id,
19+
v:educationServiceCenterReference:educationServiceCenterId::int as esc_id,
20+
v:stateEducationAgencyReference:stateEducationAgencyId::int as sea_id,
2121
-- descriptors
2222
{{ extract_descriptor('v:operationalStatusDescriptor::string') }} as operational_status,
2323
{{ extract_descriptor('v:charterStatusDescriptor::string') }} as charter_status,

models/staging/edfi_3/stage/stg_ef3__education_service_centers.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ keyed as(
77
{{ dbt_utils.surrogate_key(
88
[
99
'tenant_code',
10-
'service_center_id'
10+
'esc_id'
1111
]
12-
)}} as k_education_service_center,
12+
)}} as k_esc,
1313
base_service_centers.*
1414
{{ extract_extension(model_name=this.name, flatten=True) }}
1515
from base_service_centers
@@ -18,7 +18,7 @@ deduped as (
1818
{{
1919
dbt_utils.deduplicate(
2020
relation='keyed',
21-
partition_by='k_education_service_center',
21+
partition_by='k_esc',
2222
order_by='api_year desc, pull_timestamp desc'
2323
)
2424
}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{ flatten_addresses('stg_ef3__education_service_centers', ['k_education_service_center']) }}
1+
{{ flatten_addresses('stg_ef3__education_service_centers', ['k_esc']) }}

models/staging/edfi_3/stage/stg_ef3__education_service_centers__identification_codes.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ flattened as (
55
select
66
tenant_code,
77
api_year,
8-
k_education_service_center,
8+
k_esc,
99
{{ extract_descriptor('value:educationOrganizationIdentificationSystemDescriptor::string') }} as id_system,
1010
value:identificationCode::string as id_code
1111
from stg_service_centers,

models/staging/edfi_3/stage/stg_ef3__local_education_agencies.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ keyed as (
1010
) }} as k_lea,
1111
{{ gen_skey('k_lea', 'parent_local_education_agency_reference', 'k_lea__parent') }},
1212
{{ gen_skey('k_sea') }},
13-
{# {{ gen_skey('k_esc') }}, #}
13+
{{ gen_skey('k_esc') }},
1414
base_local_education_agencies.*
1515
{{ extract_extension(model_name=this.name, flatten=True) }}
1616
from base_local_education_agencies

0 commit comments

Comments
 (0)