platform-plugin-aspects 0.9.2__tar.gz → 0.9.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/CHANGELOG.rst +17 -0
- {platform_plugin_aspects-0.9.2/platform_plugin_aspects.egg-info → platform_plugin_aspects-0.9.4}/PKG-INFO +18 -1
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/__init__.py +1 -1
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/extensions/filters.py +11 -3
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/management/commands/load_test_tracking_events.py +0 -1
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +2 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/settings/common.py +1 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/sinks/serializers.py +27 -1
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/templates/instructor_dashboard/aspects.html +3 -2
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4/platform_plugin_aspects.egg-info}/PKG-INFO +18 -1
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/LICENSE +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/MANIFEST.in +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/README.rst +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/apps.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/extensions/__init__.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/management/__init__.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/management/commands/__init__.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/management/commands/dump_data_to_clickhouse.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/settings/__init__.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/settings/production.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/signals.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/sinks/__init__.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/sinks/base_sink.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/sinks/course_overview_sink.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/sinks/external_id_sink.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/sinks/user_profile_sink.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/sinks/user_retire_sink.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/static/css/superset.css +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/static/html/superset.html +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/static/html/superset_student.html +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/static/js/embed_dashboard.js +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/static/js/install_required.js +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/static/js/superset.js +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/tasks.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/urls.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/utils.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/views.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/waffle.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/xblock.py +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects.egg-info/SOURCES.txt +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects.egg-info/dependency_links.txt +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects.egg-info/entry_points.txt +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects.egg-info/not-zip-safe +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects.egg-info/requires.txt +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects.egg-info/top_level.txt +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/requirements/base.in +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/requirements/constraints.txt +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/setup.cfg +0 -0
- {platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/setup.py +0 -0
|
@@ -14,6 +14,23 @@ Change Log
|
|
|
14
14
|
Unreleased
|
|
15
15
|
**********
|
|
16
16
|
|
|
17
|
+
0.9.4 - 2024-05-16
|
|
18
|
+
******************
|
|
19
|
+
|
|
20
|
+
Fixes
|
|
21
|
+
=====
|
|
22
|
+
|
|
23
|
+
* Allow to serialize dates as strings in JSON.
|
|
24
|
+
|
|
25
|
+
0.9.3 - 2024-05-15
|
|
26
|
+
******************
|
|
27
|
+
|
|
28
|
+
Fixes
|
|
29
|
+
=====
|
|
30
|
+
|
|
31
|
+
* Change wording of the "go to Superset" link, and make it optional.
|
|
32
|
+
|
|
33
|
+
|
|
17
34
|
0.9.2 - 2024-05-08
|
|
18
35
|
******************
|
|
19
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.4
|
|
4
4
|
Summary: Aspects plugins for edx-platform
|
|
5
5
|
Home-page: https://github.com/openedx/platform-plugin-aspects
|
|
6
6
|
Author: Open edX Project
|
|
@@ -276,6 +276,23 @@ Change Log
|
|
|
276
276
|
Unreleased
|
|
277
277
|
**********
|
|
278
278
|
|
|
279
|
+
0.9.4 - 2024-05-16
|
|
280
|
+
******************
|
|
281
|
+
|
|
282
|
+
Fixes
|
|
283
|
+
=====
|
|
284
|
+
|
|
285
|
+
* Allow to serialize dates as strings in JSON.
|
|
286
|
+
|
|
287
|
+
0.9.3 - 2024-05-15
|
|
288
|
+
******************
|
|
289
|
+
|
|
290
|
+
Fixes
|
|
291
|
+
=====
|
|
292
|
+
|
|
293
|
+
* Change wording of the "go to Superset" link, and make it optional.
|
|
294
|
+
|
|
295
|
+
|
|
279
296
|
0.9.2 - 2024-05-08
|
|
280
297
|
******************
|
|
281
298
|
|
|
@@ -30,12 +30,18 @@ class AddSupersetTab(PipelineStep):
|
|
|
30
30
|
"""
|
|
31
31
|
course = context["course"]
|
|
32
32
|
dashboards = settings.ASPECTS_INSTRUCTOR_DASHBOARDS
|
|
33
|
+
show_dashboard_link = settings.SUPERSET_SHOW_INSTRUCTOR_DASHBOARD_LINK
|
|
33
34
|
|
|
34
35
|
user = get_current_user()
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
try:
|
|
38
|
+
user_language = (
|
|
39
|
+
get_model("user_preference").get_value(user, "pref-lang") or "en"
|
|
40
|
+
)
|
|
41
|
+
# If there is no user_preferences model defined this will get thrown
|
|
42
|
+
except AttributeError:
|
|
43
|
+
user_language = "en"
|
|
44
|
+
|
|
39
45
|
formatted_language = user_language.lower().replace("-", "_")
|
|
40
46
|
if formatted_language not in [
|
|
41
47
|
loc.lower().replace("-", "_") for loc in settings.SUPERSET_DASHBOARD_LOCALES
|
|
@@ -62,7 +68,9 @@ class AddSupersetTab(PipelineStep):
|
|
|
62
68
|
"superset_guest_token_url": str(context.get("superset_guest_token_url")),
|
|
63
69
|
"superset_url": str(context.get("superset_url")),
|
|
64
70
|
"template_path_prefix": TEMPLATE_ABSOLUTE_PATH,
|
|
71
|
+
"show_dashboard_link": show_dashboard_link,
|
|
65
72
|
}
|
|
73
|
+
|
|
66
74
|
context["sections"].append(section_data)
|
|
67
75
|
return {
|
|
68
76
|
"context": context,
|
|
@@ -142,8 +142,10 @@ class Monitor:
|
|
|
142
142
|
while True:
|
|
143
143
|
start = datetime.datetime.now()
|
|
144
144
|
log.info(f"----------- {start} --------")
|
|
145
|
+
lag = None
|
|
145
146
|
|
|
146
147
|
current_stats = {"clickhouse": self.get_clickhouse_stats()}
|
|
148
|
+
lag = -1
|
|
147
149
|
if collect_redis_bus:
|
|
148
150
|
current_stats["redis_bus"] = self.get_redis_bus_stats()
|
|
149
151
|
lag = current_stats["redis_bus"]["lag"]
|
|
@@ -46,6 +46,7 @@ def plugin_settings(settings):
|
|
|
46
46
|
"allow_translations": True,
|
|
47
47
|
},
|
|
48
48
|
]
|
|
49
|
+
settings.SUPERSET_SHOW_INSTRUCTOR_DASHBOARD_LINK = True
|
|
49
50
|
settings.SUPERSET_EXTRA_FILTERS_FORMAT = []
|
|
50
51
|
settings.SUPERSET_DASHBOARD_LOCALES = ["en"]
|
|
51
52
|
settings.EVENT_SINK_CLICKHOUSE_BACKEND_CONFIG = {
|
|
@@ -2,13 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
import uuid
|
|
5
|
+
from datetime import date, datetime
|
|
5
6
|
|
|
6
7
|
from django.utils import timezone
|
|
8
|
+
from pytz import UTC
|
|
7
9
|
from rest_framework import serializers
|
|
8
10
|
|
|
9
11
|
from platform_plugin_aspects.utils import get_model, get_tags_for_block
|
|
10
12
|
|
|
11
13
|
|
|
14
|
+
class DateTimeJSONEncoder(json.JSONEncoder):
|
|
15
|
+
"""JSON encoder aware of datetime.datetime and datetime.date objects"""
|
|
16
|
+
|
|
17
|
+
def default(self, obj): # pylint: disable=arguments-renamed
|
|
18
|
+
"""
|
|
19
|
+
Serialize datetime and date objects of iso format.
|
|
20
|
+
|
|
21
|
+
datetime objects are converted to UTC.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
if isinstance(obj, datetime):
|
|
25
|
+
if obj.tzinfo is None:
|
|
26
|
+
# Localize to UTC naive datetime objects
|
|
27
|
+
obj = UTC.localize(obj) # pylint: disable=no-value-for-parameter
|
|
28
|
+
else:
|
|
29
|
+
# Convert to UTC datetime objects from other timezones
|
|
30
|
+
obj = obj.astimezone(UTC)
|
|
31
|
+
return obj.isoformat()
|
|
32
|
+
elif isinstance(obj, date):
|
|
33
|
+
return obj.isoformat()
|
|
34
|
+
|
|
35
|
+
return super().default(obj)
|
|
36
|
+
|
|
37
|
+
|
|
12
38
|
class BaseSinkSerializer(serializers.Serializer): # pylint: disable=abstract-method
|
|
13
39
|
"""Base sink serializer for ClickHouse."""
|
|
14
40
|
|
|
@@ -148,7 +174,7 @@ class CourseOverviewSerializer(BaseSinkSerializer, serializers.ModelSerializer):
|
|
|
148
174
|
"language": getattr(overview, "language", ""),
|
|
149
175
|
"tags": get_tags_for_block(overview.id),
|
|
150
176
|
}
|
|
151
|
-
return json.dumps(json_fields)
|
|
177
|
+
return json.dumps(json_fields, cls=DateTimeJSONEncoder)
|
|
152
178
|
|
|
153
179
|
def get_course_key(self, overview):
|
|
154
180
|
"""Return the course key as a string."""
|
|
@@ -9,12 +9,13 @@ from openedx.core.djangolib.markup import HTML
|
|
|
9
9
|
<%include file="/courseware/xqa_interface.html/"/>
|
|
10
10
|
<%
|
|
11
11
|
superset_url = section_data.get("superset_url")
|
|
12
|
+
show_superset_link = superset_url and section_data.get("show_dashboard_link")
|
|
12
13
|
%>
|
|
13
14
|
|
|
14
15
|
<section class="superset">
|
|
15
|
-
% if
|
|
16
|
+
% if show_superset_link:
|
|
16
17
|
<div class="superset-link">
|
|
17
|
-
<a href="${superset_url}login/openedxsso">${_("
|
|
18
|
+
<a href="${superset_url}login/openedxsso">${_("View dashboards in Superset")}</a>
|
|
18
19
|
</div>
|
|
19
20
|
% endif
|
|
20
21
|
${HTML(section_data['fragment'].body_html())}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: platform-plugin-aspects
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.4
|
|
4
4
|
Summary: Aspects plugins for edx-platform
|
|
5
5
|
Home-page: https://github.com/openedx/platform-plugin-aspects
|
|
6
6
|
Author: Open edX Project
|
|
@@ -276,6 +276,23 @@ Change Log
|
|
|
276
276
|
Unreleased
|
|
277
277
|
**********
|
|
278
278
|
|
|
279
|
+
0.9.4 - 2024-05-16
|
|
280
|
+
******************
|
|
281
|
+
|
|
282
|
+
Fixes
|
|
283
|
+
=====
|
|
284
|
+
|
|
285
|
+
* Allow to serialize dates as strings in JSON.
|
|
286
|
+
|
|
287
|
+
0.9.3 - 2024-05-15
|
|
288
|
+
******************
|
|
289
|
+
|
|
290
|
+
Fixes
|
|
291
|
+
=====
|
|
292
|
+
|
|
293
|
+
* Change wording of the "go to Superset" link, and make it optional.
|
|
294
|
+
|
|
295
|
+
|
|
279
296
|
0.9.2 - 2024-05-08
|
|
280
297
|
******************
|
|
281
298
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/apps.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/signals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/tasks.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/urls.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/utils.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/views.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/waffle.py
RENAMED
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/platform_plugin_aspects/xblock.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{platform_plugin_aspects-0.9.2 → platform_plugin_aspects-0.9.4}/requirements/constraints.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|