From ca0d8bd748e897fc68862af87d2ec39d657d95e3 Mon Sep 17 00:00:00 2001 From: Sara Burns Date: Tue, 22 Oct 2024 12:02:12 -0400 Subject: [PATCH] Revert "feat: fix enrollment count, fix tag filter, misc updates" --- .../pythonpath/aspects_asset_list.yaml | 1 + .../assets/charts/Course_Info_b2fff8.yaml | 18 ++++++++---------- .../charts/Enrollment_Counts_7eaf5b.yaml | 9 +++++---- .../Learner_Performance_Breakdown_b73b0a.yaml | 8 +++++--- .../charts/Learner_Performance_b518f3.yaml | 9 +++++---- .../charts/Video_Engagement_5b00f7.yaml | 12 +++++------- .../charts/Video_Engagement_6b7610.yaml | 12 +++++------- .../assets/datasets/course_information.yaml | 4 ++-- .../assets/datasets/tag_filter.yaml | 18 ++---------------- .../datasets/watched_video_duration.yaml | 9 --------- .../queries/tag_filter_dataset.sql | 19 ++++++++----------- 11 files changed, 46 insertions(+), 73 deletions(-) diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/aspects_asset_list.yaml b/tutoraspects/templates/aspects/apps/superset/pythonpath/aspects_asset_list.yaml index 528776a4c..2c74e213b 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/aspects_asset_list.yaml +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/aspects_asset_list.yaml @@ -12,6 +12,7 @@ unused_uuids: - 4250c976-a9b7-43ff-b5ad-8dd00a5acef7 # Learner performance breakdown - 9c3f7291-1bd9-4b2f-abc0-472aad3aff06 # Learner performance breakdown - 8b0535a8-a43f-49bf-9d50-439a16bd3f74 # Video engagement + - fa249dda-78da-4ccc-9ef3-39177e6aae0c # Course Information ignored_uuids: datasets: diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Course_Info_b2fff8.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Course_Info_b2fff8.yaml index dd4a8a6cf..d0cfff243 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Course_Info_b2fff8.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Course_Info_b2fff8.yaml @@ -12,6 +12,7 @@ params: operator: TEMPORAL_RANGE subject: emission_time all_columns: [] + annotation_layers: [] color_pn: false column_config: active_count: @@ -29,8 +30,7 @@ params: groupby: - course_name - org - - datasourceWarning: false - expressionType: SQL + - expressionType: SQL label: More details sqlExpression: |- {% raw %}{{ get_filtered_dashboard_link('course-dashboard', 'course_name', 'IfS-Rd0ZS') }}{% endraw %} @@ -50,7 +50,7 @@ params: viz_type: table query_context: datasource: - id: 50 + id: 651 type: table force: false form_data: @@ -75,15 +75,14 @@ query_context: truncateLongCells: true conditional_formatting: [] dashboards: - - 22 - datasource: 50__table + - 355 + datasource: 651__table extra_form_data: {} force: false groupby: - course_name - org - - datasourceWarning: false - expressionType: SQL + - expressionType: SQL label: More details sqlExpression: |- {% raw %}{{ get_filtered_dashboard_link('course-dashboard', 'course_name', 'IfS-Rd0ZS') }}{% endraw %} @@ -99,7 +98,7 @@ query_context: result_type: full row_limit: 50000 show_cell_bars: false - slice_id: 25 + slice_id: 1298 table_timestamp_format: smart_date temporal_columns_lookup: {} time_grain_sqla: P1M @@ -110,8 +109,7 @@ query_context: columns: - course_name - org - - datasourceWarning: false - expressionType: SQL + - expressionType: SQL label: More details sqlExpression: |- {% raw %}{{ get_filtered_dashboard_link('course-dashboard', 'course_name', 'IfS-Rd0ZS') }}{% endraw %} diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Enrollment_Counts_7eaf5b.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Enrollment_Counts_7eaf5b.yaml index f0eef250e..012fd94d1 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Enrollment_Counts_7eaf5b.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Enrollment_Counts_7eaf5b.yaml @@ -34,7 +34,7 @@ params: viz_type: pivot_table_v2 query_context: datasource: - id: 50 + id: 221 type: table force: false form_data: @@ -45,11 +45,12 @@ query_context: operator: TEMPORAL_RANGE subject: emission_time aggregateFunction: Sum - annotation_layers: [] colOrder: key_a_to_z colSubTotals: false conditional_formatting: [] - datasource: 50__table + dashboards: + - 3141 + datasource: 221__table date_format: smart_date extra_form_data: {} force: false @@ -65,7 +66,7 @@ query_context: result_type: full rowOrder: key_a_to_z row_limit: 10000 - slice_id: 19 + slice_id: 161 temporal_columns_lookup: {} time_grain_sqla: P1D valueFormat: SMART_NUMBER diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_Breakdown_b73b0a.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_Breakdown_b73b0a.yaml index 23ea07176..36bf9a8dc 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_Breakdown_b73b0a.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_Breakdown_b73b0a.yaml @@ -49,7 +49,7 @@ params: zoomable: false query_context: datasource: - id: 84 + id: 464 type: table force: false form_data: @@ -62,7 +62,9 @@ query_context: annotation_layers: [] color_scheme: supersetColors contributionMode: null - datasource: 84__table + dashboards: + - 3441 + datasource: 464__table extra_form_data: {} force: false groupby: [] @@ -83,7 +85,7 @@ query_context: show_empty_columns: false show_legend: true show_value: false - slice_id: 75 + slice_id: 1504 sort_series_ascending: true sort_series_type: name stack: null diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_b518f3.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_b518f3.yaml index dc62c36cb..40a5ba11c 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_b518f3.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Learner_Performance_b518f3.yaml @@ -45,14 +45,13 @@ params: viz_type: table query_context: datasource: - id: 18 + id: 61 type: table force: false form_data: adhoc_filters: [] all_columns: - success - annotation_layers: [] color_pn: true column_config: avg_course_grade: @@ -63,7 +62,9 @@ query_context: med_course_grade: d3NumberFormat: ',.1%' conditional_formatting: [] - datasource: 18__table + dashboards: + - 3141 + datasource: 61__table extra_form_data: {} force: false groupby: @@ -83,7 +84,7 @@ query_context: row_limit: 50000 server_page_length: 10 show_cell_bars: false - slice_id: 109 + slice_id: 1506 table_timestamp_format: smart_date temporal_columns_lookup: {} time_grain_sqla: P1M diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_5b00f7.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_5b00f7.yaml index 9a5731b19..9ccaf808d 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_5b00f7.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_5b00f7.yaml @@ -18,8 +18,8 @@ params: groupby: - course_name - org + - video_count metrics: - - num_videos - watched_percent - rewatched_percent - avg_video_length @@ -28,7 +28,6 @@ params: percent_metrics: [] query_mode: aggregate row_limit: 50000 - server_page_length: 10 show_cell_bars: false table_timestamp_format: smart_date temporal_columns_lookup: {} @@ -49,15 +48,15 @@ query_context: d3NumberFormat: ',.1%' conditional_formatting: [] dashboards: - - 741 + - 441 datasource: 161__table extra_form_data: {} force: false groupby: - course_name - org + - video_count metrics: - - num_videos - watched_percent - rewatched_percent - avg_video_length @@ -68,7 +67,6 @@ query_context: result_format: json result_type: full row_limit: 50000 - server_page_length: 10 show_cell_bars: false slice_id: 1121 table_timestamp_format: smart_date @@ -80,6 +78,7 @@ query_context: columns: - course_name - org + - video_count custom_form_data: {} custom_params: {} extras: @@ -87,13 +86,12 @@ query_context: where: '' filters: [] metrics: - - num_videos - watched_percent - rewatched_percent - avg_video_length order_desc: true orderby: - - - num_videos + - - watched_percent - false post_processing: [] row_limit: 50000 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_6b7610.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_6b7610.yaml index aa40fe004..61c98c9fc 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_6b7610.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/charts/Video_Engagement_6b7610.yaml @@ -18,8 +18,8 @@ params: groupby: - course_run - course_name + - video_count metrics: - - num_videos - watched_percent - rewatched_percent - avg_video_length @@ -28,7 +28,6 @@ params: percent_metrics: [] query_mode: aggregate row_limit: 50000 - server_page_length: 10 show_cell_bars: false table_timestamp_format: smart_date temporal_columns_lookup: {} @@ -49,15 +48,15 @@ query_context: d3NumberFormat: ',.1%' conditional_formatting: [] dashboards: - - 741 + - 441 datasource: 161__table extra_form_data: {} force: false groupby: - course_run - course_name + - video_count metrics: - - num_videos - watched_percent - rewatched_percent - avg_video_length @@ -68,7 +67,6 @@ query_context: result_format: json result_type: full row_limit: 50000 - server_page_length: 10 show_cell_bars: false slice_id: 641 table_timestamp_format: smart_date @@ -80,6 +78,7 @@ query_context: columns: - course_run - course_name + - video_count custom_form_data: {} custom_params: {} extras: @@ -87,13 +86,12 @@ query_context: where: '' filters: [] metrics: - - num_videos - watched_percent - rewatched_percent - avg_video_length order_desc: true orderby: - - - num_videos + - - watched_percent - false post_processing: [] row_limit: 50000 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/course_information.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/course_information.yaml index 56c142e25..a78b564eb 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/course_information.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/course_information.yaml @@ -104,7 +104,7 @@ metrics: - currency: null d3format: null description: null - expression: uniq(active_learner,course_run) + expression: uniq((active_learner,course_run)) extra: warning_markdown: '' metric_name: active_count @@ -125,7 +125,7 @@ metrics: - currency: null d3format: null description: null - expression: uniq(actor_id,course_run) + expression: uniq((actor_id,course_run)) extra: warning_markdown: '' metric_name: enrollees diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/tag_filter.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/tag_filter.yaml index 99c8f06f1..563dc484e 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/tag_filter.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/tag_filter.yaml @@ -38,18 +38,6 @@ columns: python_date_format: null type: String verbose_name: Tag -- advanced_data_type: null - column_name: course_key - description: null - expression: null - extra: {} - filterable: true - groupby: true - is_active: true - is_dttm: false - python_date_format: null - type: String - verbose_name: Course Key database_uuid: 21174b6c-4d40-4958-8161-d6c3cf5e77b6 default_endpoint: null description: null @@ -62,8 +50,7 @@ metrics: d3format: null description: null expression: COUNT(*) - extra: - warning_markdown: '' + extra: {} metric_name: count metric_type: count verbose_name: COUNT(*) @@ -72,8 +59,7 @@ metrics: d3format: null description: null expression: min(rownum) - extra: - warning_markdown: '' + extra: {} metric_name: order metric_type: null verbose_name: order diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/watched_video_duration.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/watched_video_duration.yaml index 0c97a731b..d96d8289f 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/watched_video_duration.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/watched_video_duration.yaml @@ -157,15 +157,6 @@ metrics: metric_type: null verbose_name: Avg Video Length (seconds) warning_text: null -- currency: null - d3format: null - description: null - expression: avg(video_count) - extra: {} - metric_name: num_videos - metric_type: null - verbose_name: Number of Videos - warning_text: null - currency: null d3format: null description: null diff --git a/tutoraspects/templates/openedx-assets/queries/tag_filter_dataset.sql b/tutoraspects/templates/openedx-assets/queries/tag_filter_dataset.sql index de81a2158..05bc2a308 100644 --- a/tutoraspects/templates/openedx-assets/queries/tag_filter_dataset.sql +++ b/tutoraspects/templates/openedx-assets/queries/tag_filter_dataset.sql @@ -1,15 +1,12 @@ -select id, rownum, tag, course_key -from - ( +with + data as ( select id, - multiIf(parent = 0, id, CAST(parent, 'int')) as sort_order_1, - multiIf(parent = 0, 0, 1) as sort_order_2, + case when parent = 0 then id else cast(parent as int) end as sort_order_1, + case when parent = 0 then 0 else 1 end as sort_order_2, concat(repeat('- ', countMatches(lineage, ',')), value) as tag, - row_number() over ( - order by sort_order_1 ASC, sort_order_2 ASC, value ASC - ) as rownum + row_number() over (order by sort_order_1, sort_order_2, value) as rownum from {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_tags - ) as t -left join - {{ DBT_PROFILE_TARGET_DATABASE }}.most_recent_course_tags ct on ct.tag_id = t.id + ) +select id, rownum, tag +from data