Skip to content

Commit

Permalink
Create dim_platform model (#1364)
Browse files Browse the repository at this point in the history
* create dim_platform model

* update description

* add OCW and remove extra space

* update id and add missing seed file definition

* remove cast
  • Loading branch information
rachellougee authored Nov 8, 2024
1 parent 522fe71 commit 00bd178
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
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

0 comments on commit 00bd178

Please sign in to comment.