Skip to content

Commit

Permalink
fix: csv file name and skill top chart data ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-ammar committed Nov 14, 2024
1 parent 8a50701 commit ab98035
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Unreleased

=========================

[10.5.0] - 2024-11-14
---------------------
* Fix CSV file names
* Fix ordering of skills charts data

[10.4.0] - 2024-11-14
---------------------
* Updated text for null emails record of leaderboard.
Expand All @@ -35,8 +40,8 @@ Unreleased

[10.0.1] - 2024-10-25
---------------------
* Same as ``10.0.0``
* Bumping the version so a new tag can be created in the GitHub
* Same as ``10.0.0``
* Bumping the version so a new tag can be created in the GitHub

[10.0.0] - 2024-10-25
---------------------
Expand Down
2 changes: 1 addition & 1 deletion enterprise_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Enterprise data api application. This Django app exposes API endpoints used by enterprises.
"""

__version__ = "10.4.0"
__version__ = "10.5.0"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def get_top_skills_by_enrollment():
WITH TopSkills AS (
-- Get top 10 skills by total enrollments
SELECT
skill_name
skill_name,
SUM(enrolls) AS total_enrollment_count
FROM
skills_daily_rollup_admin_dash
WHERE
Expand All @@ -47,7 +48,7 @@ def get_top_skills_by_enrollment():
GROUP BY
skill_name
ORDER BY
SUM(enrolls) DESC
total_enrollment_count DESC
LIMIT 10
)
SELECT
Expand All @@ -70,7 +71,7 @@ def get_top_skills_by_enrollment():
GROUP BY
sd.skill_name, subject_name
ORDER BY
subject_name;
total_enrollment_count DESC;
"""

@staticmethod
Expand All @@ -82,7 +83,8 @@ def get_top_skills_by_completion():
WITH TopSkills AS (
-- Get top 10 skills by total completions
SELECT
skill_name
skill_name,
SUM(completions) AS total_completion_count
FROM
skills_daily_rollup_admin_dash
WHERE
Expand All @@ -91,7 +93,7 @@ def get_top_skills_by_completion():
GROUP BY
skill_name
ORDER BY
SUM(completions) DESC
total_completion_count DESC
LIMIT 10
)
SELECT
Expand All @@ -114,5 +116,5 @@ def get_top_skills_by_completion():
GROUP BY
sd.skill_name, subject_name
ORDER BY
subject_name;
total_completion_count DESC;
"""
2 changes: 1 addition & 1 deletion enterprise_data/api/v1/views/analytics_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def list(self, request, enterprise_uuid):
)

if response_type == ResponseType.CSV.value:
filename = f"""individual_completions, {start_date} - {end_date}.csv"""
filename = f"""Individual Completions, {start_date} - {end_date}.csv"""

return StreamingHttpResponse(
IndividualCompletionsCSVRenderer().render(self._stream_serialized_data(
Expand Down
2 changes: 1 addition & 1 deletion enterprise_data/api/v1/views/analytics_engagements.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def list(self, request, enterprise_uuid):
)

if response_type == ResponseType.CSV.value:
filename = f"""individual_engagements, {start_date} - {end_date}.csv"""
filename = f"""Individual Engagements, {start_date} - {end_date}.csv"""

return StreamingHttpResponse(
IndividualEngagementsCSVRenderer().render(self._stream_serialized_data(
Expand Down
2 changes: 1 addition & 1 deletion enterprise_data/api/v1/views/analytics_enrollments.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def list(self, request, enterprise_uuid):
)

if response_type == ResponseType.CSV.value:
filename = f"""individual_enrollments, {start_date} - {end_date}.csv"""
filename = f"""Individual Enrollments, {start_date} - {end_date}.csv"""

return StreamingHttpResponse(
IndividualEnrollmentsCSVRenderer().render(self._stream_serialized_data(
Expand Down

0 comments on commit ab98035

Please sign in to comment.