File tree Expand file tree Collapse file tree 3 files changed +9
-23
lines changed Expand file tree Collapse file tree 3 files changed +9
-23
lines changed Original file line number Diff line number Diff line change 18
18
19
19
from sentry import eventtypes
20
20
from sentry .db .models import NodeData
21
+ from sentry .grouping .api import get_grouping_config_dict_for_project
21
22
from sentry .grouping .variants import BaseVariant
22
23
from sentry .interfaces .base import Interface , get_interfaces
23
24
from sentry .issues .grouptype import GroupCategory
@@ -329,9 +330,10 @@ def get_event_metadata(self) -> dict[str, Any]:
329
330
330
331
def get_grouping_config (self ) -> GroupingConfig :
331
332
"""Returns the event grouping config."""
332
- from sentry .grouping .api import get_grouping_config_dict_for_event_data
333
333
334
- return get_grouping_config_dict_for_event_data (self .data , self .project )
334
+ return self .data .get ("grouping_config" ) or get_grouping_config_dict_for_project (
335
+ self .project
336
+ )
335
337
336
338
def get_hashes_and_variants (
337
339
self , config : StrategyConfiguration | None = None
Original file line number Diff line number Diff line change 9
9
10
10
from sentry import options
11
11
from sentry .conf .server import DEFAULT_GROUPING_CONFIG
12
- from sentry .db .models .fields .node import NodeData
13
12
from sentry .grouping .component import (
14
13
AppGroupingComponent ,
15
14
BaseGroupingComponent ,
@@ -182,11 +181,6 @@ def get_grouping_config_dict_for_project(project: Project) -> GroupingConfig:
182
181
return loader .get_config_dict (project )
183
182
184
183
185
- def get_grouping_config_dict_for_event_data (data : NodeData , project : Project ) -> GroupingConfig :
186
- """Returns the grouping config for an event dictionary."""
187
- return data .get ("grouping_config" ) or get_grouping_config_dict_for_project (project )
188
-
189
-
190
184
def _get_default_base64_enhancements (config_id : str | None = None ) -> str :
191
185
base : str | None = DEFAULT_ENHANCEMENTS_BASE
192
186
if config_id is not None and config_id in GROUPING_CONFIG_CLASSES .keys ():
Original file line number Diff line number Diff line change @@ -262,27 +262,17 @@ def variant_processor(self, func: VariantProcessor) -> VariantProcessor:
262
262
self .variant_processor_func = func
263
263
return func
264
264
265
- def get_grouping_component (
266
- self , event : Event , context : GroupingContext
267
- ) -> None | BaseGroupingComponent [Any ] | ReturnedVariants :
268
- """Create a grouping component using this strategy."""
269
- interface = event .interfaces .get (self .interface_name )
270
-
271
- if interface is None :
272
- return None
273
-
274
- with context :
275
- return self (interface , event = event , context = context )
276
-
277
265
def get_grouping_components (self , event : Event , context : GroupingContext ) -> ReturnedVariants :
278
266
"""
279
267
Return a dictionary, keyed by variant name, of components produced by this strategy.
280
268
"""
281
- components_by_variant = self .get_grouping_component (event , context )
282
- if components_by_variant is None :
269
+ interface = event .interfaces .get (self .interface_name )
270
+
271
+ if interface is None :
283
272
return {}
284
273
285
- assert isinstance (components_by_variant , dict )
274
+ with context :
275
+ components_by_variant = self (interface , event = event , context = context )
286
276
287
277
final_components_by_variant = {}
288
278
priority_contributing_variants_by_hash = {}
You can’t perform that action at this time.
0 commit comments