Skip to content

Commit

Permalink
more changes for micromasters_program_id
Browse files Browse the repository at this point in the history
  • Loading branch information
rachellougee committed Nov 6, 2023
1 parent f1379ce commit c36f6f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/ol_dbt/models/intermediate/mitx/_int_mitx__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ models:
tests:
- unique
- name: micromasters_program_id
description: int, primary key representing the program in the MicroMasters database
tests:
- unique
description: int, primary key representing the program in the MicroMasters database.
- name: program_description
description: str, description of the program. blank for MITx Online programs as
this field is only applicable for MicroMasters programs
Expand All @@ -29,6 +27,10 @@ models:
description: boolean, whether the program is a DEDP program
tests:
- not_null
tests:
- dbt_expectations.expect_compound_columns_to_be_unique:
column_list: ["mitxonline_program_id", "micromasters_program_id"]

- name: int__mitx__courses
description: Intermediate model for combined MITxOnline and edxorg courses
columns:
Expand Down
5 changes: 1 addition & 4 deletions src/ol_dbt/models/intermediate/mitx/int__mitx__programs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ from micromasters_programs
where micromasters_programs.program_id != {{ var("dedp_micromasters_program_id") }}
union all
select
case
when mitxonline_programs.program_id = {{ var("dedp_mitxonline_international_development_program_id") }}
then {{ var("dedp_micromasters_program_id") }}
end as micromasters_program_id
if(mitxonline_programs.program_is_dedp, {{ var("dedp_micromasters_program_id") }}, null) as micromasters_program_id
, mitxonline_programs.program_id as mitxonline_program_id
, null as program_description
, mitxonline_programs.program_title
Expand Down

0 comments on commit c36f6f2

Please sign in to comment.