Skip to content
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

feat: add graded and block_type to dim_course_blocks #48

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion models/base/dim_course_blocks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ select
courses.course_run as course_run,
blocks.location as block_id,
blocks.block_name as block_name,
blocks.display_name_with_location as display_name_with_location
blocks.display_name_with_location as display_name_with_location,
graded,
case
when block_id like '%@chapter+block@%'
then 'section'
when block_id like '%@sequential+block@%'
then 'subsection'
when block_id like '%@vertical+block@%'
then 'unit'
else regexpExtract(block_id, '@([^+]+)\+block@', 1)
bmtcril marked this conversation as resolved.
Show resolved Hide resolved
end as block_type
from {{ source("event_sink", "course_block_names") }} blocks
join
{{ source("event_sink", "course_names") }} courses
Expand Down
5 changes: 5 additions & 0 deletions models/base/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ models:
- name: display_name_with_location
data_type: String
description: "The block's display name with section, subsection, and unit prepended to the name. This provides additional context when looking at block names and can help data consumers understand which block they are analyzing"
- name: graded
data_type: Boolean
- name: block_type
data_type: String
description: "The type of block. This can be a section, subsection, unit, or the block type"
Loading