diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b18981e3..58b0ee44 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/enterprise_data/__init__.py b/enterprise_data/__init__.py index b14a50ac..b5c89900 100644 --- a/enterprise_data/__init__.py +++ b/enterprise_data/__init__.py @@ -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" diff --git a/enterprise_data/admin_analytics/database/tables/skills_daily_rollup_admin_dash.py b/enterprise_data/admin_analytics/database/tables/skills_daily_rollup_admin_dash.py index e5506020..b6a5d9a8 100644 --- a/enterprise_data/admin_analytics/database/tables/skills_daily_rollup_admin_dash.py +++ b/enterprise_data/admin_analytics/database/tables/skills_daily_rollup_admin_dash.py @@ -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, @@ -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 diff --git a/enterprise_data/management/commands/tests/test_pre_warm_analytics_cache.py b/enterprise_data/management/commands/tests/test_pre_warm_analytics_cache.py index 9d23c05e..0c75d665 100644 --- a/enterprise_data/management/commands/tests/test_pre_warm_analytics_cache.py +++ b/enterprise_data/management/commands/tests/test_pre_warm_analytics_cache.py @@ -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 diff --git a/enterprise_data/tests/api/v1/views/test_enterprise_admin.py b/enterprise_data/tests/api/v1/views/test_enterprise_admin.py index 3b09d8f9..ec09c291 100644 --- a/enterprise_data/tests/api/v1/views/test_enterprise_admin.py +++ b/enterprise_data/tests/api/v1/views/test_enterprise_admin.py @@ -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()