From 488681964050cd94b841fd295e5d590f000d7c74 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Thu, 25 Jul 2024 13:00:35 -0400 Subject: [PATCH] ref: work around partial missing overload support see python/mypy#17585 --- src/sentry/api/endpoints/group_details.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/sentry/api/endpoints/group_details.py b/src/sentry/api/endpoints/group_details.py index fcd71f72d2ae57..bbd3565942808e 100644 --- a/src/sentry/api/endpoints/group_details.py +++ b/src/sentry/api/endpoints/group_details.py @@ -104,23 +104,27 @@ def _get_context_plugins(self, request: Request, group): @staticmethod def __group_hourly_daily_stats(group: Group, environment_ids: Sequence[int]): - get_range = functools.partial( - tsdb.backend.get_range, - environment_ids=environment_ids, - tenant_ids={"organization_id": group.project.organization_id}, - ) model = get_issue_tsdb_group_model(group.issue_category) now = timezone.now() hourly_stats = tsdb.backend.rollup( - get_range(model=model, keys=[group.id], end=now, start=now - timedelta(days=1)), + tsdb.backend.get_range( + model=model, + keys=[group.id], + end=now, + start=now - timedelta(days=1), + environment_ids=environment_ids, + tenant_ids={"organization_id": group.project.organization_id}, + ), 3600, )[group.id] daily_stats = tsdb.backend.rollup( - get_range( + tsdb.backend.get_range( model=model, keys=[group.id], end=now, start=now - timedelta(days=30), + environment_ids=environment_ids, + tenant_ids={"organization_id": group.project.organization_id}, ), 3600 * 24, )[group.id]