Skip to content

Commit

Permalink
typing, update some function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ceorourke committed Jul 12, 2024
1 parent 765549f commit e8ab3f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/sentry/rules/conditions/event_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ def get_group_category_by_type_id(self, type_id: int) -> GroupCategory:
issue_type = get_group_type_by_type_id(type_id)
return GroupCategory(issue_type.category)

def get_error_and_generic_group_ids(self, groups: list[tuple[int]]) -> tuple[list[int]]:
def get_error_and_generic_group_ids(
self, groups: list[tuple[int, int, int]]
) -> tuple[list[int], list[int]]:
"""
Separate group ids into error group ids and generic group ids
"""
Expand All @@ -391,7 +393,7 @@ def get_error_and_generic_group_ids(self, groups: list[tuple[int]]) -> tuple[lis
error_issue_ids.append(group[0])
else:
generic_issue_ids.append(group[0])
return error_issue_ids, generic_issue_ids
return (error_issue_ids, generic_issue_ids)


class EventFrequencyCondition(BaseEventFrequencyCondition):
Expand All @@ -404,7 +406,8 @@ def query_hook(
sums: Mapping[int, int] = self.get_snuba_query_result(
tsdb_function=self.tsdb.get_sums,
keys=[event.group_id],
group=event.group,
group_id=event.group.id,
organization_id=event.group.project.organization_id,
model=get_issue_tsdb_group_model(event.group.issue_category),
start=start,
end=end,
Expand Down Expand Up @@ -465,7 +468,8 @@ def query_hook(
totals: Mapping[int, int] = self.get_snuba_query_result(
tsdb_function=self.tsdb.get_distinct_counts_totals,
keys=[event.group_id],
group=event.group,
group_id=event.group.id,
organization_id=event.group.project.organization_id,
model=get_issue_tsdb_user_group_model(event.group.issue_category),
start=start,
end=end,
Expand Down Expand Up @@ -620,7 +624,8 @@ def query_hook(
issue_count = self.get_snuba_query_result(
tsdb_function=self.tsdb.get_sums,
keys=[event.group_id],
group=event.group,
group_id=event.group.id,
organization_id=event.group.project.organization_id,
model=get_issue_tsdb_group_model(event.group.issue_category),
start=start,
end=end,
Expand Down
1 change: 1 addition & 0 deletions src/sentry/rules/processing/delayed_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def bucket_num_groups(num_groups: int) -> str:
return ">10"
elif num_groups > 1:
return ">1"
return "1"


def process_delayed_alert_conditions() -> None:
Expand Down

0 comments on commit e8ab3f5

Please sign in to comment.