3
3
from typing import Any
4
4
5
5
from sentry .eventstore .models import Event
6
- from sentry .grouping .component import GroupingComponent
6
+ from sentry .grouping .component import BaseGroupingComponent
7
7
from sentry .grouping .strategies .base import (
8
8
GroupingContext ,
9
9
ReturnedVariants ,
@@ -164,17 +164,17 @@ def single_exception_legacy(
164
164
interface : SingleException , event : Event , context : GroupingContext , ** meta : Any
165
165
) -> ReturnedVariants :
166
166
167
- type_component = GroupingComponent (
167
+ type_component = BaseGroupingComponent (
168
168
id = "type" ,
169
169
values = [interface .type ] if interface .type else [],
170
170
contributes = False ,
171
171
)
172
- value_component = GroupingComponent (
172
+ value_component = BaseGroupingComponent (
173
173
id = "value" ,
174
174
values = [interface .value ] if interface .value else [],
175
175
contributes = False ,
176
176
)
177
- stacktrace_component = GroupingComponent (id = "stacktrace" )
177
+ stacktrace_component = BaseGroupingComponent (id = "stacktrace" )
178
178
179
179
if interface .stacktrace is not None :
180
180
stacktrace_component = context .get_single_grouping_component (
@@ -195,7 +195,7 @@ def single_exception_legacy(
195
195
value_component .update (contributes = True )
196
196
197
197
return {
198
- context ["variant" ]: GroupingComponent (
198
+ context ["variant" ]: BaseGroupingComponent (
199
199
id = "exception" , values = [stacktrace_component , type_component , value_component ]
200
200
)
201
201
}
@@ -231,7 +231,7 @@ def chained_exception_legacy(
231
231
if stacktrace_component is None or not stacktrace_component .contributes :
232
232
value .update (contributes = False , hint = "exception has no stacktrace" )
233
233
234
- return {context ["variant" ]: GroupingComponent (id = "chained-exception" , values = values )}
234
+ return {context ["variant" ]: BaseGroupingComponent (id = "chained-exception" , values = values )}
235
235
236
236
237
237
@chained_exception_legacy .variant_processor
@@ -262,7 +262,7 @@ def frame_legacy(
262
262
# Safari throws [native code] frames in for calls like ``forEach``
263
263
# whereas Chrome ignores these. Let's remove it from the hashing algo
264
264
# so that they're more likely to group together
265
- filename_component = GroupingComponent (id = "filename" )
265
+ filename_component = BaseGroupingComponent (id = "filename" )
266
266
if interface .filename == "<anonymous>" :
267
267
filename_component .update (
268
268
contributes = False , values = [interface .filename ], hint = "anonymous filename discarded"
@@ -293,7 +293,7 @@ def frame_legacy(
293
293
# if we have a module we use that for grouping. This will always
294
294
# take precedence over the filename, even if the module is
295
295
# considered unhashable.
296
- module_component = GroupingComponent (id = "module" )
296
+ module_component = BaseGroupingComponent (id = "module" )
297
297
if interface .module :
298
298
if is_unhashable_module_legacy (interface , platform ):
299
299
module_component .update (values = ["<module>" ], hint = "normalized generated module name" )
@@ -306,7 +306,7 @@ def frame_legacy(
306
306
)
307
307
308
308
# Context line when available is the primary contributor
309
- context_line_component = GroupingComponent (id = "context-line" )
309
+ context_line_component = BaseGroupingComponent (id = "context-line" )
310
310
if interface .context_line is not None :
311
311
if len (interface .context_line ) > 120 :
312
312
context_line_component .update (hint = "discarded because line too long" )
@@ -315,9 +315,9 @@ def frame_legacy(
315
315
else :
316
316
context_line_component .update (values = [interface .context_line ])
317
317
318
- symbol_component = GroupingComponent (id = "symbol" )
319
- function_component = GroupingComponent (id = "function" )
320
- lineno_component = GroupingComponent (id = "lineno" )
318
+ symbol_component = BaseGroupingComponent (id = "symbol" )
319
+ function_component = BaseGroupingComponent (id = "function" )
320
+ lineno_component = BaseGroupingComponent (id = "lineno" )
321
321
322
322
# The context line grouping information is the most reliable one.
323
323
# If we did not manage to find some information there, we want to
@@ -369,7 +369,7 @@ def frame_legacy(
369
369
)
370
370
371
371
return {
372
- context ["variant" ]: GroupingComponent (
372
+ context ["variant" ]: BaseGroupingComponent (
373
373
id = "frame" ,
374
374
values = [
375
375
module_component ,
@@ -450,7 +450,7 @@ def threads_legacy(
450
450
thread_count = len (interface .values )
451
451
if thread_count != 1 :
452
452
return {
453
- context ["variant" ]: GroupingComponent (
453
+ context ["variant" ]: BaseGroupingComponent (
454
454
id = "threads" ,
455
455
contributes = False ,
456
456
hint = "ignored because contains %d threads" % thread_count ,
@@ -460,13 +460,13 @@ def threads_legacy(
460
460
stacktrace : Stacktrace = interface .values [0 ].get ("stacktrace" )
461
461
if not stacktrace :
462
462
return {
463
- context ["variant" ]: GroupingComponent (
463
+ context ["variant" ]: BaseGroupingComponent (
464
464
id = "threads" , contributes = False , hint = "thread has no stacktrace"
465
465
)
466
466
}
467
467
468
468
return {
469
- context ["variant" ]: GroupingComponent (
469
+ context ["variant" ]: BaseGroupingComponent (
470
470
id = "threads" ,
471
471
values = [context .get_single_grouping_component (stacktrace , event = event , ** meta )],
472
472
)
0 commit comments