diff --git a/src/sentry/rules/conditions/event_frequency.py b/src/sentry/rules/conditions/event_frequency.py index d9ec64143b15ee..a170ff5be6f958 100644 --- a/src/sentry/rules/conditions/event_frequency.py +++ b/src/sentry/rules/conditions/event_frequency.py @@ -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 """ @@ -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): @@ -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, @@ -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, @@ -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, diff --git a/src/sentry/rules/processing/delayed_processing.py b/src/sentry/rules/processing/delayed_processing.py index 77d1ec640ca426..fe2e1971b994b8 100644 --- a/src/sentry/rules/processing/delayed_processing.py +++ b/src/sentry/rules/processing/delayed_processing.py @@ -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: