8000 Replace namedtuple with regular class object. · DataDog/datadog-lambda-python@63177c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 63177c5

Browse files
committed
Replace namedtuple with regular class object.
1 parent 335d7da commit 63177c5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/test_tracing.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import collections
21
import copy
32
import functools
43
import json
@@ -1363,9 +1362,16 @@ def test_remaps_specific_inferred_span_service_names_from_eventbridge_ 8000 event(
13631362
self.assertEqual(span2.get_tag("operation_name"), "aws.eventbridge")
13641363
self.assertEqual(span2.service, "eventbridge")
13651364

1366-
_Span = collections.namedtuple(
1367-
"Span", ("service", "start", "span_type", "parent_name", "tags"),
1368-
defaults=(None, {}))
1365+
1366+
class _Span(object):
1367+
def __init__(self, service, start, span_type, parent_name=None, tags=None):
1368+
self.service = service
1369+
self.start = start
1370+
self.span_type = span_type
1371+
self.parent_name = parent_name
1372+
self.tags = tags or {}
1373+
1374+
13691375
_test_create_inferred_span = (
13701376
("api-gateway", _Span(
13711377
service="70ixmpl4fl.execute-api.us-east-2.amazonaws.com",

0 commit comments

Comments
 (0)
0