Skip to content

Commit 2562d79

Browse files
committed
Improve TransactionSource to not have multiple inheritence
1 parent 189e4a9 commit 2562d79

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sentry_sdk/tracing.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class TransactionKwargs(SpanKwargs, total=False):
131131

132132
# Transaction source
133133
# see https://develop.sentry.dev/sdk/event-payloads/transaction/#transaction-annotations
134-
class TransactionSource(str, Enum):
134+
class TransactionSource(Enum):
135135
COMPONENT = "component"
136136
CUSTOM = "custom"
137137
ROUTE = "route"
@@ -143,6 +143,12 @@ def __str__(self):
143143
# type: () -> str
144144
return self.value
145145

146+
def __eq__(self, other):
147+
# type: (Any) -> bool
148+
if isinstance(other, str):
149+
return self.value == other
150+
return super().__eq__(other)
151+
146152

147153
# These are typically high cardinality and the server hates them
148154
LOW_QUALITY_TRANSACTION_SOURCES = [

0 commit comments

Comments
 (0)