Skip to content

Commit

Permalink
feat: update dbt and use new param view
Browse files Browse the repository at this point in the history
  • Loading branch information
saraburns1 committed Nov 13, 2024
1 parent 29892f0 commit 3542122
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 31 deletions.
4 changes: 2 additions & 2 deletions tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@
# DBT_PROFILE_* settings get passed into the dbt_profile.yml file.
# For now we are pulling this from github, which should allow maximum
# flexibility for forking, running branches, specific versions, etc.
("DBT_REPOSITORY", "https://github.com/openedx/aspects-dbt"),
("DBT_BRANCH", "v3.33.5"),
("DBT_REPOSITORY", "https://github.com/saraburns1/aspects-dbt"),
("DBT_BRANCH", "mvtest"),
("DBT_SSH_KEY", ""),
("DBT_STATE_DIR", "/app/aspects-dbt/state"),
("DBT_PROFILES_DIR", "/app/aspects/dbt/"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ always_filter_main_dttm: false
cache_timeout: null
columns:
- advanced_data_type: null
column_name: course_name
column_name: rewatched_time
description: null
expression: ''
expression: null
extra:
warning_markdown: null
filterable: true
groupby: true
is_active: true
is_dttm: false
python_date_format: null
type: String
verbose_name: Course Name
type: Decimal(38, 2)
verbose_name: Rewatched Time
- advanced_data_type: null
column_name: video_duration
column_name: watched_time
description: null
expression: null
extra:
Expand All @@ -26,10 +26,23 @@ columns:
is_active: true
is_dttm: false
python_date_format: null
type: Int64
verbose_name: Video Duration
type: Decimal(38, 2)
verbose_name: Watched Time
- advanced_data_type: null
column_name: rewatched_time
column_name: course_name
description: null
expression: ''
extra:
warning_markdown: null
filterable: true
groupby: true
is_active: true
is_dttm: false
python_date_format: null
type: String
verbose_name: Course Name
- advanced_data_type: null
column_name: video_count
description: null
expression: null
extra:
Expand All @@ -39,10 +52,10 @@ columns:
is_active: true
is_dttm: false
python_date_format: null
type: Int64
verbose_name: Rewatched Time
type: Int32
verbose_name: Video Count
- advanced_data_type: null
column_name: watched_time
column_name: video_duration
description: null
expression: null
extra:
Expand All @@ -53,7 +66,7 @@ columns:
is_dttm: false
python_date_format: null
type: Int64
verbose_name: Watched Time
verbose_name: Video Duration
- advanced_data_type: null
column_name: actor_id
description: null
Expand Down Expand Up @@ -106,18 +119,6 @@ columns:
python_date_format: null
type: String
verbose_name: Org
- advanced_data_type: null
column_name: video_count
description: null
expression: null
extra: {}
filterable: true
groupby: true
is_active: true
is_dttm: false
python_date_format: null
type: Int32
verbose_name: Video Count
database_uuid: 21174b6c-4d40-4958-8161-d6c3cf5e77b6
default_endpoint: null
description: null
Expand All @@ -129,7 +130,7 @@ metrics:
- currency: null
d3format: null
description: null
expression: (sum(rewatched_time)/count(actor_id))/sum(video_duration)
expression: if(sum(video_duration) > 0,(sum(rewatched_time)/count(actor_id))/sum(video_duration),0)
extra:
warning_markdown: ''
metric_name: rewatched_percent
Expand All @@ -139,7 +140,7 @@ metrics:
- currency: null
d3format: null
description: null
expression: (sum(watched_time)/count(actor_id))/sum(video_duration)
expression: if(sum(watched_time)>0,(sum(watched_time)/count(actor_id))/sum(video_duration),0)
extra:
warning_markdown: ''
metric_name: watched_percent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ select
video_duration,
watched_time,
rewatched_time
from {{ ASPECTS_XAPI_DATABASE }}.watched_video_duration
left join {{ ASPECTS_EVENT_SINK_DATABASE }}.course_names as names
using org, course_key
from
{{ DBT_PROFILE_TARGET_DATABASE }}.watched_video_duration(
{% raw -%}
org_filter ={{ filter_values("org") }},
course_name_filter ={{ filter_values("course_name") }}
{%- endraw %}
) as a
left join
{{ ASPECTS_EVENT_SINK_DATABASE }}.course_names as names
on a.org = names.org
and a.course_key = names.course_key
where 1 = 1 {% include 'openedx-assets/queries/common_filters.sql' %}

0 comments on commit 3542122

Please sign in to comment.