-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add incidents_attachments, dbt dev schema
- Loading branch information
Showing
12 changed files
with
100 additions
and
17 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
32 changes: 32 additions & 0 deletions
32
src/dbt/deanslist/models/staging/stg_deanslist__incidents__attachments.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,32 @@ | ||
select | ||
i.incident_id, | ||
|
||
a.attachmenttype as attachment_type, | ||
a.contenttype as content_type, | ||
a.entityname as entity_name, | ||
a.entitytype as entity_type, | ||
a.internalfilename as internal_filename, | ||
a.internalfolder as internal_folder, | ||
a.minuserlevel as min_user_level, | ||
a.minuserlevelgroupname as min_user_level_group_name, | ||
a.publicfilename as public_filename, | ||
a.reporttype as report_type, | ||
a.sourcetype as source_type, | ||
a.url, | ||
|
||
a.filepostedat.timezone as file_posted_at__timezone, | ||
a.filepostedat.timezone_type as file_posted_at__timezone_type, | ||
|
||
cast(a.attachmentid as int) as attachment_id, | ||
cast(a.bytes as int) as bytes, | ||
cast(a.entityid as int) as entity_id, | ||
cast(a.schoolid as int) as school_id, | ||
cast(a.sourceid as int) as source_id, | ||
cast(a.studentid as int) as student_id, | ||
cast(a.termid as int) as term_id, | ||
|
||
cast(a.reportdate as date) as report_date, | ||
|
||
cast(a.filepostedat.`date` as datetime) as file_posted_at__date, | ||
from {{ ref("stg_deanslist__incidents") }} as i | ||
cross join unnest(i.attachments) as a |
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
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
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
9 changes: 9 additions & 0 deletions
9
src/dbt/kipptaf/models/deanslist/staging/stg_deanslist__incidents__attachments.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,9 @@ | ||
{{ | ||
dbt_utils.union_relations( | ||
relations=[ | ||
source("kippnewark_deanslist", "stg_deanslist__incidents__attachments"), | ||
source("kippcamden_deanslist", "stg_deanslist__incidents__attachments"), | ||
source("kippmiami_deanslist", "stg_deanslist__incidents__attachments"), | ||
] | ||
) | ||
}} |
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
4 changes: 2 additions & 2 deletions
4
src/dbt/kipptaf/models/iready/staging/stg_iready__instruction_by_lesson_pro.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{{ | ||
dbt_utils.union_relations( | ||
relations=[ | ||
source("kippnj_iready", model.name), | ||
source("kippmiami_iready", model.name), | ||
source("kippnj_iready", "stg_iready__instruction_by_lesson_pro"), | ||
source("kippmiami_iready", "stg_iready__instruction_by_lesson_pro"), | ||
] | ||
) | ||
}} |