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

Create dim_platform model #1364

Merged
merged 5 commits into from
Nov 8, 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
26 changes: 26 additions & 0 deletions src/ol_dbt/models/dimensional/_dim__models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
version: 2

models:
- name: dim_platform
description: Platform information about the technical system that a given event
is executed within the context of.
columns:
- name: platform_id
description: string, primary key for this table
tests:
- not_null
- unique
- name: platform_name
description: string, name of the platform
tests:
- not_null
- unique
- name: platform_description
description: string, description of the platform
tests:
- not_null
- name: platform_domain
description: string, domain name of the platform, e.g. mitxonline.mit.edu
tests:
- not_null
10 changes: 10 additions & 0 deletions src/ol_dbt/models/dimensional/dim_platform.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
with platforms as (
select * from {{ ref('platforms') }}
)

select
{{ generate_hash_id('id') }} as platform_id
, platform_name
, platform_description
, platform_domain
from platforms
23 changes: 23 additions & 0 deletions src/ol_dbt/seeds/_seed_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,26 @@ seeds:
description: str, organization that lists the course. e.g. MITx, MITxT
- name: platform
description: str, MITx Online or edX.org

- name: platforms
description: Platform information about the technical system that a given event
is executed within the context of.
columns:
- name: id
description: string, unique identifier for the platform, e.g., mitxonline
tests:
- not_null
- unique
- name: platform_name
description: string, name of the platform
tests:
- not_null
- unique
- name: platform_description
description: string, description of the platform
tests:
- not_null
- name: platform_domain
description: string, domain name of the platform, e.g. mitxonline.mit.edu
tests:
- not_null
7 changes: 7 additions & 0 deletions src/ol_dbt/seeds/platforms.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id,platform_name,platform_description,platform_domain
mitxonline,MITx Online,Online courses from MIT faculty and instructors,mitxonline.mit.edu
edxorg,edX.org,MIT Online courses on edX.org,www.edx.org
mitxpro,MIT xPRO,MIT Professional development courses and programs that build skills and augment careers,xpro.mit.edu
residential,MITx Residential,MITx Residential,lms.mitx.mit.edu
bootcamps,MIT Bootcamps,MIT Bootcamps,bootcamp.odl.mit.edu
ocw,OCW,MIT Open Course Ware,ocw.mit.edu