-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add edxorg api course metadata to marts (#1480)
* incorporate edxorg courses ingested from api to intemediate and mart * update * cleanup and fix errors * fix the courserun_readable_id format
- Loading branch information
1 parent
0441c0b
commit cda833d
Showing
7 changed files
with
258 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/ol_dbt/models/intermediate/edxorg/int__edxorg__mitx_product.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
with courseruns as ( | ||
select * from {{ ref('stg__edxorg__api__courserun') }} | ||
) | ||
|
||
select | ||
courseruns.courserun_readable_id | ||
, cast(json_extract_scalar(t.seat, '$.price') as decimal(38, 2)) as price | ||
, json_extract_scalar(t.seat, '$.type') as courserun_mode | ||
, json_extract_scalar(t.seat, '$.currency') as currency | ||
, json_extract_scalar(t.seat, '$.upgrade_deadline') as upgrade_deadline | ||
, json_extract_scalar(t.seat, '$.credit_provider') as credit_provider | ||
, json_extract_scalar(t.seat, '$.credit_hours') as credit_hours | ||
from courseruns | ||
cross join unnest(cast(json_parse(courseruns.courserun_enrollment_modes) as array (json))) as t (seat) -- noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters