|
1 | 1 | import inspect
|
2 | 2 | from collections.abc import Callable, Iterator, Sequence
|
3 |
| -from typing import Any, Generic, Protocol, TypeVar |
| 3 | +from typing import Any, Generic, Protocol, TypeVar, overload |
4 | 4 |
|
5 | 5 | from sentry import projectoptions
|
6 | 6 | from sentry.eventstore.models import Event
|
7 |
| -from sentry.grouping.component import BaseGroupingComponent |
| 7 | +from sentry.grouping.component import ( |
| 8 | + BaseGroupingComponent, |
| 9 | + ExceptionGroupingComponent, |
| 10 | + FrameGroupingComponent, |
| 11 | + StacktraceGroupingComponent, |
| 12 | +) |
8 | 13 | from sentry.grouping.enhancer import Enhancements
|
9 | 14 | from sentry.interfaces.base import Interface
|
| 15 | +from sentry.interfaces.exception import SingleException |
| 16 | +from sentry.interfaces.stacktrace import Frame, Stacktrace |
10 | 17 |
|
11 | 18 | STRATEGIES: dict[str, "Strategy[Any]"] = {}
|
12 | 19 |
|
@@ -118,6 +125,21 @@ def get_grouping_component(
|
118 | 125 | """
|
119 | 126 | return self._get_strategy_dict(interface, event=event, **kwargs)
|
120 | 127 |
|
| 128 | + @overload |
| 129 | + def get_single_grouping_component( |
| 130 | + self, interface: Frame, *, event: Event, **kwargs: Any |
| 131 | + ) -> FrameGroupingComponent: ... |
| 132 | + |
| 133 | + @overload |
| 134 | + def get_single_grouping_component( |
| 135 | + self, interface: SingleException, *, event: Event, **kwargs: Any |
| 136 | + ) -> ExceptionGroupingComponent: ... |
| 137 | + |
| 138 | + @overload |
| 139 | + def get_single_grouping_component( |
| 140 | + self, interface: Stacktrace, *, event: Event, **kwargs: Any |
| 141 | + ) -> StacktraceGroupingComponent: ... |
| 142 | + |
121 | 143 | def get_single_grouping_component(
|
122 | 144 | self, interface: Interface, *, event: Event, **kwargs: Any
|
123 | 145 | ) -> BaseGroupingComponent:
|
|
0 commit comments