Skip to content

Commit f9a70a8

Browse files
committed
allow id to be a class attribute
1 parent 5faa04e commit f9a70a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sentry/grouping/component.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ class GroupingComponent:
3535
into components to make a hash for grouping purposes.
3636
"""
3737

38-
id: str
38+
id: str = "default"
3939
hint: str | None
4040
contributes: bool
4141
values: Sequence[str | GroupingComponent]
4242

4343
def __init__(
4444
self,
45-
id: str,
45+
id: str | None = None,
4646
hint: str | None = None,
4747
contributes: bool | None = None,
4848
values: Sequence[str | GroupingComponent] | None = None,
4949
variant_provider: bool = False,
5050
):
51-
self.id = id
51+
self.id = id or self.id
5252

5353
# Default values
54-
self.hint = DEFAULT_HINTS.get(id)
54+
self.hint = DEFAULT_HINTS.get(self.id)
5555
self.contributes = contributes
5656
self.variant_provider = variant_provider
5757
self.values: Sequence[str | GroupingComponent] = []

0 commit comments

Comments
 (0)