Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Unreleased
----------

=========================
[10.21.13] - 2025-11-11
-----------------------
* fix: remove temporary group_uuid field presence check

[10.21.12] - 2025-10-28
-----------------------
* chore: upgrade python requirements
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.21.12"
__version__ = "10.21.13"
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,6 @@ class SkillsDailyRollupAdminDashTable(CommonFiltersMixin, BaseTable):
"""
queries = SkillsDailyRollupAdminDashQueries()

@cache_it(timeout=120) # Cache for 2 minutes
def is_group_uuid_field_present(self):
"""
Check if `group_uuid` column is present in a `skills_daily_rollup_admin_dash` table schema.
"""
COLUMN_NAME = 'group_uuid'
query = """
SELECT
distinct column_name
FROM
information_schema.columns
WHERE
table_name=%(table_name)s AND column_name=%(column_name)s;
"""
params = {
'table_name': 'skills_daily_rollup_admin_dash',
'column_name': COLUMN_NAME,
}
result = run_query(
query=query,
params=params,
as_dict=True,
)
return (
bool(result) and
result[0].get("COLUMN_NAME") == COLUMN_NAME
)

def build_query_filters(
self,
enterprise_customer_uuid: UUID,
Expand Down Expand Up @@ -124,16 +96,14 @@ def build_query_filters(
))
optional_params['budget_uuid'] = budget_uuid

# TODO: Remove `is_group_uuid_field_present` check and refactor this code block
# once we are sure that `skills_daily_rollup_admin_dash` table has `group_uuid` field.
if self.is_group_uuid_field_present():
default_group_uuid = '00000000000000000000000000000000'
group_uuid_value = group_uuid or default_group_uuid
query_filters.append(EqualQueryFilter(
column='group_uuid',
value_placeholder='group_uuid',
))
optional_params['group_uuid'] = group_uuid_value
# See https://2u-internal.atlassian.net/browse/DPMF-994?focusedCommentId=5688616 for context on default value
default_group_uuid = '00000000000000000000000000000000'
group_uuid_value = group_uuid or default_group_uuid
query_filters.append(EqualQueryFilter(
column='enterprise_group_uuid',
value_placeholder='enterprise_group_uuid',
))
optional_params['enterprise_group_uuid'] = group_uuid_value

params = {**default_params, **optional_params}
return query_filters, params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ def test_pre_warm_analytics_cache(self, mock_get_cache, mock_set_cache, mock_get

call_command('pre_warm_analytics_cache')

assert mock_get_cache.call_count == 26
assert mock_set_cache.call_count == 26
assert mock_get_cache.call_count == 23
assert mock_set_cache.call_count == 23
10 changes: 0 additions & 10 deletions enterprise_data/tests/api/v1/views/test_enterprise_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ def setUp(self):
self.mocked_get_enterprise_customer = mocked_get_enterprise_customer.start()
self.addCleanup(mocked_get_enterprise_customer.stop)

mock.patch.object(SkillsDailyRollupAdminDashTable, "is_group_uuid_field_present", return_value=False)

mock_is_group_uuid_field_present = mock.patch.object(
SkillsDailyRollupAdminDashTable,
"is_group_uuid_field_present",
return_value=False,
)
mock_is_group_uuid_field_present.start()
self.addCleanup(mock_is_group_uuid_field_present.stop)

self.enterprise_id = 'ee5e6b3a-069a-4947-bb8d-d2dbc323396c'
self.set_jwt_cookie()
self.enrollment_queries = FactEnrollmentAdminDashQueries()
Expand Down
Loading