-
Notifications
You must be signed in to change notification settings - Fork 6
Add mart for OCW resources #2236
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| --- | ||
| version: 2 | ||
|
|
||
| models: | ||
| - name: dim_ocw_resource | ||
| description: > | ||
| OCW course resources (files, external resources, video, image) sourced from | ||
| int__ocw__resources. One row per (course_uuid, resource_uuid). The raw metadata | ||
| JSON is excluded; its useful fields are surfaced as scalar columns. | ||
| meta: | ||
| owner: data_team | ||
| columns: | ||
| - name: course_uuid | ||
| description: str, UUID of the course containing the resource | ||
| tests: | ||
| - not_null | ||
| - name: course_name | ||
| description: str, name of the course | ||
| - name: course_number | ||
| description: str, primary course number of the course, from the course metadata | ||
| - name: course_title | ||
| description: str, title of the course, from the course metadata | ||
| - name: course_term | ||
| description: str, term course was taught, from the course metadata | ||
| - name: course_year | ||
| description: str, year course was taught, from the course metadata | ||
| - name: course_live_url | ||
| description: str, url of the course on production | ||
| - name: resource_uuid | ||
| description: str, UUID of the resource | ||
| tests: | ||
| - not_null | ||
| - name: resource_title | ||
| description: str, title of the resource | ||
| - name: content_type | ||
| description: str, WebsiteContent type of the resource (e.g., resource, external-resource) | ||
| - name: resource_type | ||
| description: str, resource type (image, video, etc.) | ||
| - name: resource_ocw_type | ||
| description: str, OCW content type classification of the resource | ||
| - name: resource_filename | ||
| description: str, filename of the resource file | ||
| - name: resource_file_type | ||
| description: str, file type of the resource file | ||
| - name: resource_file_size | ||
| description: str, file size of the resource file | ||
| - name: resource_draft | ||
| description: boolean, whether the resource is draft | ||
| - name: resource_live_url | ||
| description: str, live URL of the resource on production | ||
| - name: studio_url | ||
| description: str, OCW Studio URL for the resource | ||
| - name: website_title | ||
| description: str, title of the course | ||
| - name: learning_resource_types | ||
| description: str, learning resource types of the resource (e.g., Lecture Notes) | ||
| - name: resource_license | ||
| description: str, license URL of the resource (e.g., Creative Commons) | ||
| - name: resource_description | ||
| description: str, description of the resource | ||
| - name: resource_audience | ||
| description: str, intended audience of the resource as a JSON array | ||
| - name: resource_level | ||
| description: str, level of the resource as a JSON array | ||
| - name: external_resource_url | ||
| description: str, URL of the external resource | ||
| - name: external_resource_is_broken | ||
| description: boolean, whether the external resource link is broken | ||
| - name: external_resource_license_warning | ||
| description: boolean, whether the external resource has a license warning | ||
| - name: external_resource_url_status_code | ||
| description: int, status code of the external resource URL | ||
| - name: external_resource_backup_url | ||
| description: str, backup URL of the external resource | ||
| - name: external_resource_backup_url_status_code | ||
| description: int, status code of the external resource backup URL | ||
| - name: external_resource_status | ||
| description: str, link status of the external resource (e.g., valid, unchecked, | ||
| broken, check_failed) | ||
| - name: external_resource_wayback_url | ||
| description: str, Wayback Machine archive URL of the external resource | ||
| - name: image_alt_text | ||
| description: str, alt text of the image resource | ||
| - name: image_caption | ||
| description: str, caption of the image resource | ||
| - name: image_credit | ||
| description: str, credit of the image resource | ||
| - name: video_youtube_id | ||
| description: str, YouTube ID of the video | ||
| - name: video_youtube_description | ||
| description: str, description of the YouTube video | ||
| - name: video_youtube_speakers | ||
| description: str, speakers in the YouTube video | ||
| - name: video_youtube_tags | ||
| description: str, tags of the YouTube video | ||
| - name: video_archive_url | ||
| description: str, archive URL of the video | ||
| - name: video_captions_file | ||
| description: str, captions file of the video resource | ||
| - name: video_thumbnail_file | ||
| description: str, thumbnail file of the video resource | ||
| - name: video_transcript_file | ||
| description: str, transcript file of the video resource | ||
| tests: | ||
| - dbt_utils.unique_combination_of_columns: | ||
| combination_of_columns: | ||
| - course_uuid | ||
| - resource_uuid |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| {{ config( | ||
| materialized='table' | ||
| ) }} | ||
|
|
||
| select | ||
| course_uuid | ||
| , course_name | ||
| , course_number | ||
| , course_title | ||
| , course_term | ||
| , course_year | ||
| , course_live_url | ||
| , resource_uuid | ||
| , resource_title | ||
| , content_type | ||
| , resource_type | ||
| , resource_ocw_type | ||
| , resource_filename | ||
| , resource_file_type | ||
| , resource_file_size | ||
| , resource_draft | ||
| , resource_live_url | ||
| , studio_url | ||
| , website_title | ||
| , learning_resource_types | ||
| , resource_license | ||
| , resource_description | ||
| , resource_audience | ||
| , resource_level | ||
| , external_resource_url | ||
| , external_resource_is_broken | ||
| , external_resource_license_warning | ||
| , external_resource_url_status_code | ||
| , external_resource_backup_url | ||
| , external_resource_backup_url_status_code | ||
| , external_resource_status | ||
| , external_resource_wayback_url | ||
| , image_alt_text | ||
| , image_caption | ||
| , image_credit | ||
| , video_youtube_id | ||
| , video_youtube_description | ||
| , video_youtube_speakers | ||
| , video_youtube_tags | ||
| , video_archive_url | ||
| , video_captions_file | ||
| , video_thumbnail_file | ||
| , video_transcript_file | ||
| from {{ ref('int__ocw__resources') }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| select | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if you meant to leave out the config block here, it will use the project's default materialization (likely view). This should be fine since dim_ocw_resource is already a table, just wanted to note it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this was intentional. The |
||
| course_uuid | ||
| , course_name | ||
| , course_number | ||
| , course_title | ||
| , course_term | ||
| , course_year | ||
| , course_live_url | ||
| , resource_uuid | ||
| , resource_title | ||
| , content_type | ||
| , resource_type | ||
| , resource_ocw_type | ||
| , resource_filename | ||
| , resource_file_type | ||
| , resource_file_size | ||
| , resource_draft | ||
| , resource_live_url | ||
| , studio_url | ||
| , website_title | ||
| , learning_resource_types | ||
| , resource_license | ||
| , resource_description | ||
| , resource_audience | ||
| , resource_level | ||
| , external_resource_url | ||
| , external_resource_is_broken | ||
| , external_resource_license_warning | ||
| , external_resource_url_status_code | ||
| , external_resource_backup_url | ||
| , external_resource_backup_url_status_code | ||
| , external_resource_status | ||
| , external_resource_wayback_url | ||
| , image_alt_text | ||
| , image_caption | ||
| , image_credit | ||
| , video_youtube_id | ||
| , video_youtube_description | ||
| , video_youtube_speakers | ||
| , video_youtube_tags | ||
| , video_archive_url | ||
| , video_captions_file | ||
| , video_thumbnail_file | ||
| , video_transcript_file | ||
| from {{ ref('dim_ocw_resource') }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in efa4981.