@@ -245,7 +245,7 @@ def test_extract_dd_trace_context(event, expect):
245245 event = json .load (f )
246246 ctx = get_mock_context ()
247247
248- actual , _ , _ , _ , _ = extract_dd_trace_context (event , ctx )
248+ actual , _ , _ , _ = extract_dd_trace_context (event , ctx )
249249 assert (expect is None ) is (actual is None )
250250 assert (expect is None ) or actual .trace_id == expect .trace_id
251251 assert (expect is None ) or actual .span_id == expect .span_id
@@ -269,7 +269,7 @@ def tearDown(self):
269269 @with_trace_propagation_style ("datadog" )
270270 def test_without_datadog_trace_headers (self ):
271271 lambda_ctx = get_mock_context ()
272- ctx , source , _ , _ , _ = extract_dd_trace_context ({}, lambda_ctx )
272+ ctx , source , _ , _ = extract_dd_trace_context ({}, lambda_ctx )
273273 self .assertEqual (source , "xray" )
274274 self .assertEqual (
275275 ctx ,
@@ -292,7 +292,7 @@ def test_without_datadog_trace_headers(self):
292292 @with_trace_propagation_style ("datadog" )
293293 def test_with_non_object_event (self ):
294294 lambda_ctx = get_mock_context ()
295- ctx , source , _ , _ , _ = extract_dd_trace_context (b"" , lambda_ctx )
295+ ctx , source , _ , _ = extract_dd_trace_context (b"" , lambda_ctx )
296296 self .assertEqual (source , "xray" )
297297 self .assertEqual (
298298 ctx ,
@@ -315,7 +315,7 @@ def test_with_non_object_event(self):
315315 @with_trace_propagation_style ("datadog" )
316316 def test_with_incomplete_datadog_trace_headers (self ):
317317 lambda_ctx = get_mock_context ()
318- ctx , source , _ , _ , _ = extract_dd_trace_context (
318+ ctx , source , _ , _ = extract_dd_trace_context (
319319 {"headers" : {TraceHeader .TRACE_ID : "123" }},
320320 lambda_ctx ,
321321 )
@@ -340,7 +340,7 @@ def test_with_incomplete_datadog_trace_headers(self):
340340 def common_tests_with_trace_context_extraction_injection (
341341 self , headers , event_containing_headers , lambda_context = get_mock_context ()
342342 ):
343- ctx , source , _ , _ , _ = extract_dd_trace_context (
343+ ctx , source , _ , _ = extract_dd_trace_context (
344344 event_containing_headers ,
345345 lambda_context ,
346346 )
@@ -393,7 +393,7 @@ def extractor_foo(event, context):
393393 return trace_id , parent_id , sampling_priority
394394
395395 lambda_ctx = get_mock_context ()
396- ctx , ctx_source , _ , _ , _ = extract_dd_trace_context (
396+ ctx , ctx_source , _ , _ = extract_dd_trace_context (
397397 {
398398 "foo" : {
399399 TraceHeader .TRACE_ID : "123" ,
@@ -428,7 +428,7 @@ def extractor_raiser(event, context):
428428 raise Exception ("kreator" )
429429
430430 lambda_ctx = get_mock_context ()
431- ctx , ctx_source , _ , _ , _ = extract_dd_trace_context (
431+ ctx , ctx_source , _ , _ = extract_dd_trace_context (
432432 {
433433 "foo" : {
434434 TraceHeader .TRACE_ID : "123" ,
@@ -627,7 +627,7 @@ def _test_step_function_trace_data_common(
627627 TraceHeader .TAGS : f"_dd.p.tid={ expected_tid } " ,
628628 }
629629
630- ctx , source , _ , _ , _ = extract_dd_trace_context (event , lambda_ctx )
630+ ctx , source , _ , _ = extract_dd_trace_context (event , lambda_ctx )
631631
632632 self .assertEqual (source , "event" )
633633 self .assertEqual (ctx , expected_context )
@@ -1148,7 +1148,7 @@ def test_mixed_parent_context_when_merging(self):
11481148 # use the dd-trace trace-id and the x-ray parent-id
11491149 # This allows parenting relationships like dd-trace -> x-ray -> dd-trace
11501150 lambda_ctx = get_mock_context ()
1151- ctx , source , _ , _ , _ = extract_dd_trace_context (
1151+ ctx , source , _ , _ = extract_dd_trace_context (
11521152 {
11531153 "headers" : {
11541154 TraceHeader .TRACE_ID : "123" ,
@@ -1174,7 +1174,7 @@ def test_set_dd_trace_py_root_no_span_id(self):
11741174 os .environ ["_X_AMZN_TRACE_ID" ] = "Root=1-5e272390-8c398be037738dc042009320"
11751175
11761176 lambda_ctx = get_mock_context ()
1177- ctx , source , _ , _ , _ = extract_dd_trace_context (
1177+ ctx , source , _ , _ = extract_dd_trace_context (
11781178 {
11791179 "headers" : {
11801180 TraceHeader .TRACE_ID : "123" ,
@@ -2467,15 +2467,14 @@ def test_extract_context_from_sqs_event_with_datadog_context(self):
24672467 ]
24682468 }
24692469
2470- (context , dd_json_data , arn ) = extract_context_from_sqs_or_sns_event_or_context (
2470+ (context , dd_json_data ) = extract_context_from_sqs_or_sns_event_or_context (
24712471 sqs_event , lambda_ctx
24722472 )
24732473
24742474 self .assertEqual (context .trace_id , 456 )
24752475 self .assertEqual (context .span_id , 789 )
24762476 self .assertEqual (context .sampling_priority , 1 )
24772477 self .assertEqual (dd_json_data , expected_trace_data )
2478- self .assertEqual (arn , "arn:aws:sqs:us-east-1:123456789012:test-queue" )
24792478
24802479 def test_extract_context_from_sns_event_with_datadog_context (self ):
24812480 """Test SNS event extraction with datadog context returns expected values."""
@@ -2501,15 +2500,14 @@ def test_extract_context_from_sns_event_with_datadog_context(self):
25012500 ]
25022501 }
25032502
2504- (context , dd_json_data , arn ) = extract_context_from_sqs_or_sns_event_or_context (
2503+ (context , dd_json_data ) = extract_context_from_sqs_or_sns_event_or_context (
25052504 sns_event , lambda_ctx
25062505 )
25072506
25082507 self .assertEqual (context .trace_id , 111 )
25092508 self .assertEqual (context .span_id , 222 )
25102509 self .assertEqual (context .sampling_priority , 2 )
25112510 self .assertEqual (dd_json_data , expected_trace_data )
2512- self .assertEqual (arn , "arn:aws:sns:us-east-1:123456789012:test-topic" )
25132511
25142512 def test_extract_context_from_kinesis_event_with_datadog_context (self ):
25152513 """Test Kinesis event extraction with datadog context returns expected values."""
@@ -2531,16 +2529,13 @@ def test_extract_context_from_kinesis_event_with_datadog_context(self):
25312529 ]
25322530 }
25332531
2534- context , dd_json_data , arn = extract_context_from_kinesis_event (
2532+ context , dd_json_data = extract_context_from_kinesis_event (
25352533 kinesis_event , lambda_ctx
25362534 )
25372535
25382536 self .assertEqual (context .trace_id , 333 )
25392537 self .assertEqual (context .span_id , 444 )
25402538 self .assertEqual (dd_json_data , expected_trace_data )
2541- self .assertEqual (
2542- arn , "arn:aws:kinesis:us-east-1:123456789012:stream/test-stream"
2543- )
25442539
25452540 def test_step_function_context_in_sqs_calls_step_function_extractor (self ):
25462541 """Test that Step Function context in SQS calls the step function extractor."""
@@ -2564,13 +2559,12 @@ def test_step_function_context_in_sqs_calls_step_function_extractor(self):
25642559 ]
25652560 }
25662561
2567- (context , dd_json_data , arn ) = extract_context_from_sqs_or_sns_event_or_context (
2562+ (context , dd_json_data ) = extract_context_from_sqs_or_sns_event_or_context (
25682563 sfn_sqs_event , lambda_ctx
25692564 )
25702565
25712566 self .assertIsNotNone (context )
25722567 self .assertIsNone (dd_json_data )
2573- self .assertIsNone (arn )
25742568
25752569 def test_extract_context_from_sns_to_sqs_event_with_datadog_context (self ):
25762570 """Test SNS -> SQS event extraction with datadog context returns expected values."""
@@ -2605,12 +2599,11 @@ def test_extract_context_from_sns_to_sqs_event_with_datadog_context(self):
26052599 ]
26062600 }
26072601
2608- (context , dd_json_data , arn ) = extract_context_from_sqs_or_sns_event_or_context (
2602+ (context , dd_json_data ) = extract_context_from_sqs_or_sns_event_or_context (
26092603 sns_to_sqs_event , lambda_ctx
26102604 )
26112605
26122606 self .assertEqual (context .trace_id , 555 )
26132607 self .assertEqual (context .span_id , 666 )
26142608 self .assertEqual (context .sampling_priority , 1 )
26152609 self .assertEqual (dd_json_data , expected_trace_data )
2616- self .assertEqual (arn , "arn:aws:sqs:us-east-1:123456789012:test-queue" )
0 commit comments