Skip to content

Commit

Permalink
feat: add graded and block_type to dim_course_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Feb 29, 2024
1 parent 91e226d commit cbd89e8
Showing 1 changed file with 11 additions and 1 deletion.
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)
end as block_type
from {{ source("event_sink", "course_block_names") }} blocks
join
{{ source("event_sink", "course_names") }} courses
Expand Down

0 comments on commit cbd89e8

Please sign in to comment.