-
Notifications
You must be signed in to change notification settings - Fork 7
feature/StudentAssessmentEducationOrg #110
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
Draft
gnguyen87
wants to merge
11
commits into
main
Choose a base branch
from
feature/StudentAssessmentEdOrg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
08b4136
Create a base stuAssessmentEdOrg model
34b48db
Update gen_skey() macro to accommodate for new reference
d7cb935
Create stage stuAssessmentEdOrg model
a6dbd53
Fix missing curly bracket
520456a
Update gen_skey.sql
rlittle08 f59598d
Update and rename base_ef3__student_assessment_education_organization…
rlittle08 9cf94f0
Update _edfi_3__stage.yml
rlittle08 aad06ff
Update and rename stg_ef3__student_assessment_education_organizations…
rlittle08 c4d8333
Hotfix: Lower `grading_period_name` in surrogate key (#111)
jayckaiser c8b8788
Update base and stg_ef3__student_assessment_education_organization_as…
0b21cf5
use ed_org macro instead so we can pull out both k_school k_lea
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
38 changes: 38 additions & 0 deletions
38
models/staging/edfi_3/base/base_ef3__student_assessment_education_organizations.sql
This file contains hidden or 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,38 @@ | ||
| with student_assessment_education_organizations as ( | ||
| select * from {{ source_edfi3('student_assessment_education_organizations') }} | ||
| ), | ||
|
|
||
|
|
||
| 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:educationOrganizationReference:educationOrganizationId::int as ed_org_identifier, | ||
| v:educationOrganizationReference:link:rel::string as ed_org_type, | ||
| {{ extract_descriptor('v:educationOrganizationAssociationTypeDescriptor::string') }} as ed_org_association_type, | ||
| v:schoolYearTypeReference:schoolYear::int as school_year, | ||
| v:studentAssessmentReference:assessmentIdentifier::string as assement_identifier, | ||
| v:studentAssessmentReference:namespace::string as assessment_name_space, | ||
| v:studentAssessmentReference:studentAssessmentIdentifier::string as student_assessment_identifier, | ||
| v:studentAssessmentReference:studentUniqueId::string as student_id, | ||
| -- references | ||
| v:educationOrganizationReference as education_organization_reference, | ||
| v:studentAssessmentReference as student_assessment_reference | ||
| -- edfi extensions | ||
| v:_ext as v_ext | ||
| from student_assessment_education_organizations | ||
| ) | ||
|
|
||
|
|
||
| select * from renamed | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
This file contains hidden or 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
39 changes: 39 additions & 0 deletions
39
models/staging/edfi_3/stage/stg_ef3__student_assessment_education_organizations.sql
This file contains hidden or 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,39 @@ | ||
| with base as ( | ||
| select * from {{ ref('base_ef3__student_assessment_education_organizations') }} | ||
| where not is_deleted | ||
| ), | ||
|
|
||
|
|
||
| keyed as ( | ||
| select | ||
| {{ | ||
| dbt_utils.generate_surrogate_key( | ||
| [ 'tenant_code', | ||
| 'api_year', | ||
| 'ed_org_identifier', | ||
| 'ed_org_association_type', | ||
| 'assessment_identifier', | ||
| 'student_assessment_identifier', | ||
| 'student_unique_id', | ||
| 'lower(namespace)' | ||
| ] | ||
| ) | ||
| }} as k_student_assessment_ed_org, | ||
| {{ gen_skey('k_ed_org') }}, | ||
| {{ gen_skey('k_student_assessment') }} | ||
| from base | ||
| ), | ||
|
|
||
|
|
||
| deduped as ( | ||
| {{ | ||
| dbt_utils.deduplicate( | ||
| relation = 'keyed', | ||
| partition_by = 'k_student_assessment_ed_org', | ||
| order_by = 'pull_timestamp desc' | ||
| ) | ||
| }} | ||
| ) | ||
|
|
||
|
|
||
| select * from deduped | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.