edx-enterprise-data 10.11.1__py3-none-any.whl → 10.13.0__py3-none-any.whl

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.
Files changed (22) hide show
  1. {edx_enterprise_data-10.11.1.dist-info → edx_enterprise_data-10.13.0.dist-info}/METADATA +1 -1
  2. {edx_enterprise_data-10.11.1.dist-info → edx_enterprise_data-10.13.0.dist-info}/RECORD +22 -19
  3. enterprise_data/__init__.py +1 -1
  4. enterprise_data/admin_analytics/database/filters/__init__.py +2 -0
  5. enterprise_data/admin_analytics/database/filters/fact_completion_admin_dash.py +22 -0
  6. enterprise_data/admin_analytics/database/filters/fact_engagement_admin_dash.py +11 -0
  7. enterprise_data/admin_analytics/database/filters/fact_enrollment_admin_dash.py +2 -42
  8. enterprise_data/admin_analytics/database/filters/mixins.py +84 -0
  9. enterprise_data/admin_analytics/database/queries/fact_engagement_admin_dash.py +13 -18
  10. enterprise_data/admin_analytics/database/queries/fact_enrollment_admin_dash.py +20 -24
  11. enterprise_data/admin_analytics/database/tables/fact_engagement_admin_dash.py +103 -33
  12. enterprise_data/admin_analytics/database/tables/fact_enrollment_admin_dash.py +96 -74
  13. enterprise_data/api/v1/serializers.py +1 -0
  14. enterprise_data/api/v1/views/analytics_completions.py +11 -5
  15. enterprise_data/api/v1/views/analytics_engagements.py +10 -5
  16. enterprise_data/api/v1/views/enterprise_admin.py +2 -1
  17. enterprise_data/management/commands/pre_warm_analytics_cache.py +11 -0
  18. enterprise_data/tests/api/v1/views/test_enterprise_admin.py +5 -4
  19. enterprise_reporting/tests/test_delivery_method.py +1 -1
  20. {edx_enterprise_data-10.11.1.dist-info → edx_enterprise_data-10.13.0.dist-info}/WHEEL +0 -0
  21. {edx_enterprise_data-10.11.1.dist-info → edx_enterprise_data-10.13.0.dist-info}/licenses/LICENSE +0 -0
  22. {edx_enterprise_data-10.11.1.dist-info → edx_enterprise_data-10.13.0.dist-info}/top_level.txt +0 -0
@@ -56,6 +56,7 @@ class Command(BaseCommand):
56
56
  )
57
57
  enterprise_enrollment_table.get_completion_count(
58
58
  enterprise_customer_uuid=enterprise_customer_uuid,
59
+ group_uuid=None,
59
60
  start_date=start_date,
60
61
  end_date=end_date,
61
62
  )
@@ -95,6 +96,7 @@ class Command(BaseCommand):
95
96
  page_size = 100
96
97
  enterprise_enrollment_table.get_all_completions(
97
98
  enterprise_customer_uuid=enterprise_customer_uuid,
99
+ group_uuid=None,
98
100
  start_date=start_date,
99
101
  end_date=end_date,
100
102
  limit=page_size,
@@ -102,21 +104,25 @@ class Command(BaseCommand):
102
104
  )
103
105
  enterprise_enrollment_table.get_completion_count(
104
106
  enterprise_customer_uuid=enterprise_customer_uuid,
107
+ group_uuid=None,
105
108
  start_date=start_date,
106
109
  end_date=end_date,
107
110
  )
108
111
  enterprise_enrollment_table.get_top_courses_by_completions(
109
112
  enterprise_customer_uuid=enterprise_customer_uuid,
113
+ group_uuid=None,
110
114
  start_date=start_date,
111
115
  end_date=end_date,
112
116
  )
113
117
  enterprise_enrollment_table.get_top_subjects_by_completions(
114
118
  enterprise_customer_uuid=enterprise_customer_uuid,
119
+ group_uuid=None,
115
120
  start_date=start_date,
116
121
  end_date=end_date,
117
122
  )
118
123
  enterprise_enrollment_table.get_completions_time_series_data(
119
124
  enterprise_customer_uuid=enterprise_customer_uuid,
125
+ group_uuid=None,
120
126
  start_date=start_date,
121
127
  end_date=end_date,
122
128
  )
@@ -141,12 +147,14 @@ class Command(BaseCommand):
141
147
  )
142
148
  enterprise_engagement_table.get_engagement_count(
143
149
  enterprise_customer_uuid=enterprise_customer_uuid,
150
+ group_uuid=None,
144
151
  start_date=start_date,
145
152
  end_date=end_date,
146
153
  )
147
154
  page_size = 100
148
155
  enterprise_engagement_table.get_all_engagements(
149
156
  enterprise_customer_uuid=enterprise_customer_uuid,
157
+ group_uuid=None,
150
158
  start_date=start_date,
151
159
  end_date=end_date,
152
160
  limit=page_size,
@@ -154,16 +162,19 @@ class Command(BaseCommand):
154
162
  )
155
163
  enterprise_engagement_table.get_top_courses_by_engagement(
156
164
  enterprise_customer_uuid=enterprise_customer_uuid,
165
+ group_uuid=None,
157
166
  start_date=start_date,
158
167
  end_date=end_date,
159
168
  )
160
169
  enterprise_engagement_table.get_top_subjects_by_engagement(
161
170
  enterprise_customer_uuid=enterprise_customer_uuid,
171
+ group_uuid=None,
162
172
  start_date=start_date,
163
173
  end_date=end_date,
164
174
  )
165
175
  enterprise_engagement_table.get_engagement_time_series_data(
166
176
  enterprise_customer_uuid=enterprise_customer_uuid,
177
+ group_uuid=None,
167
178
  start_date=start_date,
168
179
  end_date=end_date,
169
180
  )
@@ -62,6 +62,10 @@ class TestEnterpriseAdminAnalyticsAggregatesView(JWTTestMixin, APITransactionTes
62
62
  """
63
63
  mock implementation of run_query.
64
64
  """
65
+ # Check if this is the completion_count_query being called with query_filters
66
+ if hasattr(query, '__name__') and query.__name__ == 'get_completion_count_query':
67
+ return [[50]]
68
+
65
69
  mock_responses = {
66
70
  self.enrollment_queries.get_enrollment_date_range_query(): [[
67
71
  datetime.strptime('2021-01-01', "%Y-%m-%d"),
@@ -70,15 +74,12 @@ class TestEnterpriseAdminAnalyticsAggregatesView(JWTTestMixin, APITransactionTes
70
74
  self.enrollment_queries.get_enrollment_and_course_count_query(): [[
71
75
  100, 10
72
76
  ]],
73
- self.enrollment_queries.get_completion_count_query(): [[
74
- 50
75
- ]],
76
77
  self.engagement_queries.get_learning_hours_and_daily_sessions_query(): [[
77
78
  100, 10
78
79
  ]],
79
80
  'SELECT MAX(created) FROM enterprise_learner_enrollment': [[datetime.strptime('2021-01-01', "%Y-%m-%d")]]
80
81
  }
81
- return mock_responses[query]
82
+ return mock_responses.get(query, [[]])
82
83
 
83
84
  def test_get_admin_analytics_aggregates(self):
84
85
  """
@@ -5,8 +5,8 @@ Test delivery methods.
5
5
  import unittest
6
6
 
7
7
  import ddt
8
+ from mock import MagicMock, patch
8
9
 
9
- from mock import patch, MagicMock
10
10
  from enterprise_reporting.delivery_method import SFTPDeliveryMethod, SMTPDeliveryMethod
11
11
  from enterprise_reporting.utils import encrypt_string
12
12