Skip to content

Commit

Permalink
ref: work around partial missing overload support
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile-sentry committed Jul 25, 2024
1 parent 2d46de8 commit 4886819
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/sentry/api/endpoints/group_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 4886819

Please sign in to comment.