From ada1bef0145a2de16afea3aa4e3dde99b6c656e3 Mon Sep 17 00:00:00 2001 From: AxelRay <110029405+axelray-dev@users.noreply.github.com> Date: Tue, 6 Oct 2026 08:39:32 +0800 Subject: [PATCH] style: format daily activity key types --- litellm/proxy/management_endpoints/common_daily_activity.py | 6 +++--- .../management_endpoints/test_common_daily_activity.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/litellm/proxy/management_endpoints/common_daily_activity.py b/litellm/proxy/management_endpoints/common_daily_activity.py index 8f1143e0ddd..d03de9f2e21 100644 --- a/litellm/proxy/management_endpoints/common_daily_activity.py +++ b/litellm/proxy/management_endpoints/common_daily_activity.py @@ -625,9 +625,9 @@ async def get_user_api_key_filter( api_key: str | None, ) -> list[str]: """Return the key digests that should scope a user activity query.""" - active_keys: Final[Sequence[_UserApiKeyRecord]] = await VerificationTokenRepository( - prisma_client - ).find_by_user_id(user_id) + active_keys: Final[Sequence[_UserApiKeyRecord]] = await VerificationTokenRepository(prisma_client).find_by_user_id( + user_id + ) deleted_keys: Final = await _get_deleted_keys_for_user(prisma_client, user_id) user_api_keys: Final = list( dict.fromkeys( diff --git a/tests/unit/proxy/management_endpoints/test_common_daily_activity.py b/tests/unit/proxy/management_endpoints/test_common_daily_activity.py index b2d001cb8b7..d99b4abcb88 100644 --- a/tests/unit/proxy/management_endpoints/test_common_daily_activity.py +++ b/tests/unit/proxy/management_endpoints/test_common_daily_activity.py @@ -19,8 +19,8 @@ from litellm.proxy.management_endpoints.common_daily_activity import ( daily_activity_repository, daily_activity_scope, get_api_key_metadata, - get_user_api_key_filter, get_daily_activity, + get_user_api_key_filter, parse_canonical_date, parse_canonical_date_range, raise_public, @@ -2544,6 +2544,7 @@ async def test_get_daily_activity_rejects_non_canonical_dates_before_querying(st mock_table.count.assert_not_awaited() mock_table.find_many.assert_not_awaited() + @pytest.mark.asyncio async def test_get_user_api_key_filter_scopes_to_active_and_deleted_user_keys(): mock_prisma = MagicMock()