Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Course dashboard updates from the Edunext sandbox #862

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tutoraspects/asset_command_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,16 @@ class ChartAsset(Asset):
raw_vars = ["sqlExpression", "query_context", "translate_column"]

def process(self, content: dict, existing: dict):
if not content.get("query_context"):
if not content.get("query_context") and existing:
content["query_context"] = existing.get("query_context")
query_context = content["query_context"]
if query_context is not None and isinstance(query_context, str):
content["query_context"] = json.loads(query_context)
# run templated vars again to update query_context
self.omit_templated_vars(
content["query_context"], existing.get("query_context")
)
if existing:
self.omit_templated_vars(
content["query_context"], existing.get("query_context")
)


class DashboardAsset(Asset):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ certified_by: null
dataset_uuid: 633a1d4e-cd40-482f-a5dc-d5901c2181c2
description: null
params:
adhoc_filters: []
adhoc_filters:
- clause: WHERE
comparator: No filter
expressionType: SIMPLE
operator: TEMPORAL_RANGE
subject: enrolled_at
all_columns: []
annotation_layers: []
color_pn: true
column_config:
Avg Course Grade:
Expand Down Expand Up @@ -54,7 +58,6 @@ params:
- course_name
- course_run
metrics:
- graded_learners
- avg_course_grade
- median_course_grade
order_by_cols: []
Expand All @@ -65,16 +68,22 @@ params:
server_page_length: 10
show_cell_bars: true
table_timestamp_format: smart_date
temporal_columns_lookup: {}
temporal_columns_lookup:
enrolled_at: true
time_grain_sqla: P1D
viz_type: table
query_context:
datasource:
id: 282
id: 54
type: table
force: false
form_data:
adhoc_filters: []
adhoc_filters:
- clause: WHERE
comparator: No filter
expressionType: SIMPLE
operator: TEMPORAL_RANGE
subject: enrolled_at
all_columns: []
color_pn: true
column_config:
Expand All @@ -89,9 +98,35 @@ query_context:
column: graded_learners
operator: '>'
targetValue: 0
- colorScheme: '#FDE380'
column: avg_course_grade
operator: "\u2264 x \u2264"
targetValueLeft: '50'
targetValueRight: '70'
- colorScheme: '#EFA1AA'
column: avg_course_grade
operator: <
targetValue: 50
- colorScheme: '#ACE1C4'
column: avg_course_grade
operator: "\u2265"
targetValue: 70
- colorScheme: '#ACE1C4'
column: median_course_grade
operator: "\u2265"
targetValue: 70
- colorScheme: '#FDE380'
column: median_course_grade
operator: "\u2264 x \u2264"
targetValueLeft: '50'
targetValueRight: '70'
- colorScheme: '#EFA1AA'
column: median_course_grade
operator: <
targetValue: 50
dashboards:
- 629
datasource: 282__table
- 28
datasource: 54__table
extra_form_data: {}
force: false
groupby:
Expand All @@ -100,7 +135,6 @@ query_context:
- course_name
- course_run
metrics:
- graded_learners
- avg_course_grade
- median_course_grade
order_by_cols: []
Expand All @@ -112,9 +146,10 @@ query_context:
row_limit: 1000
server_page_length: 10
show_cell_bars: true
slice_id: 528
slice_id: 5
table_timestamp_format: smart_date
temporal_columns_lookup: {}
temporal_columns_lookup:
enrolled_at: true
time_grain_sqla: P1D
viz_type: table
queries:
Expand All @@ -131,14 +166,16 @@ query_context:
having: ''
time_grain_sqla: P1D
where: ''
filters: []
filters:
- col: enrolled_at
op: TEMPORAL_RANGE
val: No filter
metrics:
- graded_learners
- avg_course_grade
- median_course_grade
order_desc: true
orderby:
- - graded_learners
- - avg_course_grade
- false
post_processing: []
row_limit: 1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ params:
zoomable: true
query_context:
datasource:
id: 424
id: 29
type: table
force: false
form_data:
Expand All @@ -81,9 +81,7 @@ query_context:
annotation_layers: []
color_scheme: supersetColors
comparison_type: values
dashboards:
- 629
datasource: 424__table
datasource: 29__table
extra_form_data: {}
force: false
forecastInterval: 0.8
Expand All @@ -110,7 +108,7 @@ query_context:
show_extra_controls: false
show_legend: true
show_value: false
slice_id: 439
slice_id: 30
sort_series_type: sum
time_grain_sqla: P1M
tooltipTimeFormat: smart_date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ params:
forecastInterval: 0.8
forecastPeriods: 10
groupby: []
legendMargin: null
legendOrientation: top
legendType: scroll
markerEnabled: true
markerSize: 7
markerSize: 6
metrics:
- views
- number_of_learners
Expand All @@ -31,19 +30,18 @@ params:
order_desc: true
rich_tooltip: true
rolling_type: cumsum
row_limit: 1000
row_limit: 10000
seriesType: line
show_empty_columns: true
show_legend: true
show_value: false
sort_series_ascending: true
sort_series_type: sum
time_grain_sqla: P1M
tooltipTimeFormat: smart_date
truncateXAxis: true
truncate_metric: true
viz_type: echarts_timeseries_line
x_axis: visited_on
x_axis_sort: Views
x_axis_sort_asc: true
x_axis_sort_series: name
x_axis_sort_series_ascending: true
Expand All @@ -58,7 +56,7 @@ params:
zoomable: true
query_context:
datasource:
id: 61
id: 73
type: table
force: false
form_data:
Expand All @@ -72,18 +70,17 @@ query_context:
color_scheme: supersetColors
comparison_type: values
dashboards:
- 629
datasource: 61__table
- 28
datasource: 73__table
extra_form_data: {}
force: false
forecastInterval: 0.8
forecastPeriods: 10
groupby: []
legendMargin: null
legendOrientation: top
legendType: scroll
markerEnabled: true
markerSize: 7
markerSize: 6
metrics:
- views
- number_of_learners
Expand All @@ -94,22 +91,19 @@ query_context:
result_type: full
rich_tooltip: true
rolling_type: cumsum
row_limit: 1000
row_limit: 10000
seriesType: line
show_empty_columns: true
show_legend: true
show_value: false
slice_id: 140
slice_id: 62
sort_series_ascending: true
sort_series_type: sum
time_grain_sqla: P1M
tooltipTimeFormat: smart_date
truncateXAxis: true
truncate_metric: true
viz_type: echarts_timeseries_line
xAxisForceCategorical: true
x_axis: visited_on
x_axis_sort: Views
x_axis_sort_asc: true
x_axis_sort_series: name
x_axis_sort_series_ascending: true
Expand Down Expand Up @@ -167,7 +161,7 @@ query_context:
views: views
operator: sum
- operation: flatten
row_limit: 1000
row_limit: 10000
series_columns: []
series_limit: 0
time_offsets: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ params:
y_axis_format: ',d'
query_context:
datasource:
id: 271
id: 35
type: table
force: false
form_data:
Expand All @@ -66,17 +66,16 @@ query_context:
operatorId: IN
sqlExpression: null
subject: enrollment_status
annotation_layers: []
conditional_formatting: []
dashboards:
- 629
datasource: 271__table
datasource: 35__table
extra_form_data: {}
force: false
header_font_size: 0.4
metric: number_of_learners
result_format: json
result_type: full
slice_id: 229
slice_id: 8
subheader_font_size: 0.2
time_format: smart_date
viz_type: big_number_total
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ params:
forecastInterval: 0.8
forecastPeriods: 10
groupby: []
legendMargin: null
legendOrientation: top
legendType: scroll
metrics:
Expand All @@ -24,7 +25,7 @@ params:
row_limit: 10000
show_empty_columns: true
show_legend: true
show_value: true
show_value: false
sort_series_type: sum
tooltipTimeFormat: smart_date
truncateXAxis: true
Expand All @@ -45,22 +46,21 @@ params:
y_axis_title_position: Left
query_context:
datasource:
id: 282
id: 54
type: table
force: false
form_data:
adhoc_filters: []
annotation_layers: []
color_scheme: supersetColors
comparison_type: values
dashboards:
- 629
datasource: 282__table
datasource: 54__table
extra_form_data: {}
force: false
forecastInterval: 0.8
forecastPeriods: 10
groupby: []
legendMargin: null
legendOrientation: top
legendType: scroll
metrics:
Expand All @@ -74,8 +74,8 @@ query_context:
row_limit: 10000
show_empty_columns: true
show_legend: true
show_value: true
slice_id: 532
show_value: false
slice_id: 95
sort_series_type: sum
tooltipTimeFormat: smart_date
truncateXAxis: true
Expand Down
Loading