Skip to content

Commit

Permalink
feat: import latest version of course dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed May 6, 2024
1 parent ca535fa commit b110f31
Show file tree
Hide file tree
Showing 23 changed files with 2,322 additions and 414 deletions.
6 changes: 3 additions & 3 deletions tutoraspects/asset_command_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ def omit_templated_vars(self, content: dict, existing: dict):
else:
content[key] = existing[key]

if isinstance(existing[key], dict):
if isinstance(content[key], dict):
self.omit_templated_vars(content[key], existing[key])

if isinstance(existing[key], list):
if isinstance(content[key], list):
for i, item in enumerate(content[key]):
if isinstance(item, dict):
try:
Expand All @@ -161,7 +161,7 @@ class ChartAsset(Asset):
"params.datasource",
"params.slice_id",
]
raw_vars = ["sqlExpression", "query_context"]
raw_vars = ["query_context"]


class DashboardAsset(Asset):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ description: null
params:
adhoc_filters: []
all_columns: []
annotation_layers: []
color_pn: true
column_config:
Avg Course Grade:
d3NumberFormat: ~g
d3SmallNumberFormat: ~g
Median Course Grade:
d3NumberFormat: ~g
d3SmallNumberFormat: ~g
conditional_formatting:
- colorScheme: '#ACE1C4'
column: Graded Learners
Expand All @@ -17,29 +23,29 @@ params:
- colorScheme: '#FDE380'
column: Avg Course Grade
operator: "\u2264 x \u2264"
targetValueLeft: '0.5'
targetValueRight: '0.7'
targetValueLeft: '50'
targetValueRight: '70'
- colorScheme: '#EFA1AA'
column: Avg Course Grade
operator: <
targetValue: 0.5
targetValue: 50
- colorScheme: '#ACE1C4'
column: Avg Course Grade
operator: "\u2265"
targetValue: 0.7
targetValue: 70
- colorScheme: '#ACE1C4'
column: Median Course Grade
operator: "\u2265"
targetValue: 0.7
targetValue: 70
- colorScheme: '#FDE380'
column: Median Course Grade
operator: "\u2264 x \u2264"
targetValueLeft: '0.5'
targetValueRight: '0.7'
targetValueLeft: '50'
targetValueRight: '70'
- colorScheme: '#EFA1AA'
column: Median Course Grade
operator: <
targetValue: 0.5
targetValue: 50
extra_form_data: {}
groupby:
- org
Expand All @@ -54,14 +60,14 @@ params:
certified_by: null
column_name: actor_id
description: null
expression: null
expression: ''
filterable: true
groupby: true
id: 457
id: 538
is_certified: false
is_dttm: false
python_date_format: null
type: STRING
type: String
type_generic: 1
verbose_name: null
warning_markdown: null
Expand All @@ -71,38 +77,22 @@ params:
label: Graded Learners
optionName: metric_25t7qgbwxu5_a9fbiaboytw
sqlExpression: null
- aggregate: AVG
column:
advanced_data_type: null
certification_details: null
certified_by: null
column_name: course_grade
description: null
expression: null
filterable: true
groupby: true
id: 461
is_certified: false
is_dttm: false
python_date_format: null
type: FLOAT64
type_generic: 0
verbose_name: null
warning_markdown: null
- aggregate: null
column: null
datasourceWarning: false
expressionType: SIMPLE
expressionType: SQL
hasCustomLabel: true
label: Avg Course Grade
optionName: metric_i5mlkxng7kb_5auir2yzvnx
sqlExpression: null
sqlExpression: round(AVG(course_grade),2) * 100
- aggregate: null
column: null
datasourceWarning: false
expressionType: SQL
hasCustomLabel: true
label: Median Course Grade
optionName: metric_prd604bf33n_j3zxzos2g5
sqlExpression: 'quantile(0.5)(course_grade) '
sqlExpression: 'quantile(0.5)(round(course_grade,2) * 100) '
order_by_cols: []
order_desc: true
percent_metrics: []
Expand All @@ -114,71 +104,66 @@ params:
temporal_columns_lookup: {}
time_grain_sqla: P1D
viz_type: table
query_context: "{\"datasource\":{\"id\":70,\"type\":\"table\"},\"force\":false,\"\
query_context: "{\"datasource\":{\"id\":54,\"type\":\"table\"},\"force\":false,\"\
queries\":[{\"filters\":[],\"extras\":{\"time_grain_sqla\":\"P1D\",\"having\":\"\
\",\"where\":\"\"},\"applied_time_extras\":{},\"columns\":[\"org\",\"course_key\"\
,\"course_name\",\"course_run\"],\"metrics\":[{\"aggregate\":\"COUNT_DISTINCT\"\
,\"column\":{\"advanced_data_type\":null,\"certification_details\":null,\"certified_by\"\
:null,\"column_name\":\"actor_id\",\"description\":null,\"expression\":null,\"filterable\"\
:true,\"groupby\":true,\"id\":457,\"is_certified\":false,\"is_dttm\":false,\"python_date_format\"\
:null,\"type\":\"STRING\",\"type_generic\":1,\"verbose_name\":null,\"warning_markdown\"\
:null,\"column_name\":\"actor_id\",\"description\":null,\"expression\":\"\",\"filterable\"\
:true,\"groupby\":true,\"id\":538,\"is_certified\":false,\"is_dttm\":false,\"python_date_format\"\
:null,\"type\":\"String\",\"type_generic\":1,\"verbose_name\":null,\"warning_markdown\"\
:null},\"datasourceWarning\":false,\"expressionType\":\"SIMPLE\",\"hasCustomLabel\"\
:true,\"label\":\"Graded Learners\",\"optionName\":\"metric_25t7qgbwxu5_a9fbiaboytw\"\
,\"sqlExpression\":null},{\"aggregate\":\"AVG\",\"column\":{\"advanced_data_type\"\
:null,\"certification_details\":null,\"certified_by\":null,\"column_name\":\"course_grade\"\
,\"description\":null,\"expression\":null,\"filterable\":true,\"groupby\":true,\"\
id\":461,\"is_certified\":false,\"is_dttm\":false,\"python_date_format\":null,\"\
type\":\"FLOAT64\",\"type_generic\":0,\"verbose_name\":null,\"warning_markdown\"\
:null},\"datasourceWarning\":false,\"expressionType\":\"SIMPLE\",\"hasCustomLabel\"\
:true,\"label\":\"Avg Course Grade\",\"optionName\":\"metric_i5mlkxng7kb_5auir2yzvnx\"\
,\"sqlExpression\":null},{\"aggregate\":null,\"column\":null,\"datasourceWarning\"\
:false,\"expressionType\":\"SQL\",\"hasCustomLabel\":true,\"label\":\"Median Course\
\ Grade\",\"optionName\":\"metric_prd604bf33n_j3zxzos2g5\",\"sqlExpression\":\"\
quantile(0.5)(course_grade) \"}],\"orderby\":[[{\"aggregate\":\"COUNT_DISTINCT\"\
,\"column\":{\"advanced_data_type\":null,\"certification_details\":null,\"certified_by\"\
:null,\"column_name\":\"actor_id\",\"description\":null,\"expression\":null,\"filterable\"\
:true,\"groupby\":true,\"id\":457,\"is_certified\":false,\"is_dttm\":false,\"python_date_format\"\
:null,\"type\":\"STRING\",\"type_generic\":1,\"verbose_name\":null,\"warning_markdown\"\
:null},\"datasourceWarning\":false,\"expressionType\":\"SIMPLE\",\"hasCustomLabel\"\
:true,\"label\":\"Graded Learners\",\"optionName\":\"metric_25t7qgbwxu5_a9fbiaboytw\"\
,\"sqlExpression\":null},false]],\"annotation_layers\":[],\"row_limit\":1000,\"\
series_limit\":0,\"order_desc\":true,\"url_params\":{},\"custom_params\":{},\"custom_form_data\"\
:{},\"post_processing\":[]}],\"form_data\":{\"datasource\":\"70__table\",\"viz_type\"\
:\"table\",\"slice_id\":186,\"query_mode\":\"aggregate\",\"groupby\":[\"org\",\"\
course_key\",\"course_name\",\"course_run\"],\"time_grain_sqla\":\"P1D\",\"temporal_columns_lookup\"\
:{},\"metrics\":[{\"aggregate\":\"COUNT_DISTINCT\",\"column\":{\"advanced_data_type\"\
:null,\"certification_details\":null,\"certified_by\":null,\"column_name\":\"actor_id\"\
,\"description\":null,\"expression\":null,\"filterable\":true,\"groupby\":true,\"\
id\":457,\"is_certified\":false,\"is_dttm\":false,\"python_date_format\":null,\"\
type\":\"STRING\",\"type_generic\":1,\"verbose_name\":null,\"warning_markdown\"\
:null},\"datasourceWarning\":false,\"expressionType\":\"SIMPLE\",\"hasCustomLabel\"\
:true,\"label\":\"Graded Learners\",\"optionName\":\"metric_25t7qgbwxu5_a9fbiaboytw\"\
,\"sqlExpression\":null},{\"aggregate\":\"AVG\",\"column\":{\"advanced_data_type\"\
:null,\"certification_details\":null,\"certified_by\":null,\"column_name\":\"course_grade\"\
,\"description\":null,\"expression\":null,\"filterable\":true,\"groupby\":true,\"\
id\":461,\"is_certified\":false,\"is_dttm\":false,\"python_date_format\":null,\"\
type\":\"FLOAT64\",\"type_generic\":0,\"verbose_name\":null,\"warning_markdown\"\
:null},\"datasourceWarning\":false,\"expressionType\":\"SIMPLE\",\"hasCustomLabel\"\
:true,\"label\":\"Avg Course Grade\",\"optionName\":\"metric_i5mlkxng7kb_5auir2yzvnx\"\
,\"sqlExpression\":null},{\"aggregate\":null,\"column\":null,\"datasourceWarning\"\
:false,\"expressionType\":\"SQL\",\"hasCustomLabel\":true,\"label\":\"Avg Course\
\ Grade\",\"optionName\":\"metric_i5mlkxng7kb_5auir2yzvnx\",\"sqlExpression\":\"\
round(AVG(course_grade),2) * 100\"},{\"aggregate\":null,\"column\":null,\"datasourceWarning\"\
:false,\"expressionType\":\"SQL\",\"hasCustomLabel\":true,\"label\":\"Median Course\
\ Grade\",\"optionName\":\"metric_prd604bf33n_j3zxzos2g5\",\"sqlExpression\":\"\
quantile(0.5)(course_grade) \"}],\"all_columns\":[],\"percent_metrics\":[],\"adhoc_filters\"\
:[],\"order_by_cols\":[],\"row_limit\":1000,\"server_page_length\":10,\"order_desc\"\
:true,\"table_timestamp_format\":\"smart_date\",\"show_cell_bars\":true,\"color_pn\"\
:true,\"conditional_formatting\":[{\"colorScheme\":\"#ACE1C4\",\"column\":\"Graded\
\ Learners\",\"operator\":\">\",\"targetValue\":0},{\"colorScheme\":\"#FDE380\"\
,\"column\":\"Avg Course Grade\",\"operator\":\"\u2264 x \u2264\",\"targetValueLeft\"\
:\"0.5\",\"targetValueRight\":\"0.7\"},{\"colorScheme\":\"#EFA1AA\",\"column\":\"\
Avg Course Grade\",\"operator\":\"<\",\"targetValue\":0.5},{\"colorScheme\":\"#ACE1C4\"\
,\"column\":\"Avg Course Grade\",\"operator\":\"\u2265\",\"targetValue\":0.7},{\"\
colorScheme\":\"#ACE1C4\",\"column\":\"Median Course Grade\",\"operator\":\"\u2265\
\",\"targetValue\":0.7},{\"colorScheme\":\"#FDE380\",\"column\":\"Median Course\
\ Grade\",\"operator\":\"\u2264 x \u2264\",\"targetValueLeft\":\"0.5\",\"targetValueRight\"\
:\"0.7\"},{\"colorScheme\":\"#EFA1AA\",\"column\":\"Median Course Grade\",\"operator\"\
:\"<\",\"targetValue\":0.5}],\"extra_form_data\":{},\"dashboards\":[16],\"force\"\
:false,\"result_format\":\"json\",\"result_type\":\"full\"},\"result_format\":\"\
json\",\"result_type\":\"full\"}"
quantile(0.5)(round(course_grade,2) * 100) \"}],\"orderby\":[[{\"aggregate\":\"\
COUNT_DISTINCT\",\"column\":{\"advanced_data_type\":null,\"certification_details\"\
:null,\"certified_by\":null,\"column_name\":\"actor_id\",\"description\":null,\"\
expression\":\"\",\"filterable\":true,\"groupby\":true,\"id\":538,\"is_certified\"\
:false,\"is_dttm\":false,\"python_date_format\":null,\"type\":\"String\",\"type_generic\"\
:1,\"verbose_name\":null,\"warning_markdown\":null},\"datasourceWarning\":false,\"\
expressionType\":\"SIMPLE\",\"hasCustomLabel\":true,\"label\":\"Graded Learners\"\
,\"optionName\":\"metric_25t7qgbwxu5_a9fbiaboytw\",\"sqlExpression\":null},false]],\"\
annotation_layers\":[],\"row_limit\":1000,\"series_limit\":0,\"order_desc\":true,\"\
url_params\":{},\"custom_params\":{},\"custom_form_data\":{},\"post_processing\"\
:[]}],\"form_data\":{\"datasource\":\"54__table\",\"viz_type\":\"table\",\"slice_id\"\
:128,\"query_mode\":\"aggregate\",\"groupby\":[\"org\",\"course_key\",\"course_name\"\
,\"course_run\"],\"time_grain_sqla\":\"P1D\",\"temporal_columns_lookup\":{},\"metrics\"\
:[{\"aggregate\":\"COUNT_DISTINCT\",\"column\":{\"advanced_data_type\":null,\"certification_details\"\
:null,\"certified_by\":null,\"column_name\":\"actor_id\",\"description\":null,\"\
expression\":\"\",\"filterable\":true,\"groupby\":true,\"id\":538,\"is_certified\"\
:false,\"is_dttm\":false,\"python_date_format\":null,\"type\":\"String\",\"type_generic\"\
:1,\"verbose_name\":null,\"warning_markdown\":null},\"datasourceWarning\":false,\"\
expressionType\":\"SIMPLE\",\"hasCustomLabel\":true,\"label\":\"Graded Learners\"\
,\"optionName\":\"metric_25t7qgbwxu5_a9fbiaboytw\",\"sqlExpression\":null},{\"aggregate\"\
:null,\"column\":null,\"datasourceWarning\":false,\"expressionType\":\"SQL\",\"\
hasCustomLabel\":true,\"label\":\"Avg Course Grade\",\"optionName\":\"metric_i5mlkxng7kb_5auir2yzvnx\"\
,\"sqlExpression\":\"round(AVG(course_grade),2) * 100\"},{\"aggregate\":null,\"\
column\":null,\"datasourceWarning\":false,\"expressionType\":\"SQL\",\"hasCustomLabel\"\
:true,\"label\":\"Median Course Grade\",\"optionName\":\"metric_prd604bf33n_j3zxzos2g5\"\
,\"sqlExpression\":\"quantile(0.5)(round(course_grade,2) * 100) \"}],\"all_columns\"\
:[],\"percent_metrics\":[],\"adhoc_filters\":[],\"order_by_cols\":[],\"row_limit\"\
:1000,\"server_page_length\":10,\"order_desc\":true,\"table_timestamp_format\":\"\
smart_date\",\"show_cell_bars\":true,\"color_pn\":true,\"column_config\":{\"Avg\
\ Course Grade\":{\"d3NumberFormat\":\"~g\",\"d3SmallNumberFormat\":\"~g\"},\"Median\
\ Course Grade\":{\"d3NumberFormat\":\"~g\",\"d3SmallNumberFormat\":\"~g\"}},\"\
conditional_formatting\":[{\"colorScheme\":\"#ACE1C4\",\"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}],\"extra_form_data\":{},\"dashboards\":[9],\"force\":false,\"\
result_format\":\"json\",\"result_type\":\"full\"},\"result_format\":\"json\",\"\
result_type\":\"full\"}"
slice_name: Course Information
uuid: fa249dda-78da-4ccc-9ef3-39177e6aae0c
version: 1.0.0
Expand Down
Loading

0 comments on commit b110f31

Please sign in to comment.