Skip to content

Commit fb1f45a

Browse files
clean
1 parent 0ac942a commit fb1f45a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

datadog_lambda/tracing.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,10 @@ def extract_context_from_sqs_or_sns_event_or_context(event, lambda_context):
269269
if config.data_streams_enabled:
270270
from ddtrace.data_streams import PROPAGATION_KEY_BASE_64
271271

272-
data_streams_ctx = (
273-
{PROPAGATION_KEY_BASE_64: dd_data[PROPAGATION_KEY_BASE_64]}
274-
if PROPAGATION_KEY_BASE_64 in dd_data
275-
else {}
276-
)
272+
if PROPAGATION_KEY_BASE_64 in dd_data:
273+
data_streams_ctx = {
274+
PROPAGATION_KEY_BASE_64: dd_data[PROPAGATION_KEY_BASE_64]
275+
}
277276

278277
if is_step_function_event(dd_data):
279278
try:
@@ -392,11 +391,11 @@ def extract_context_from_kinesis_event(event, lambda_context):
392391
if config.data_streams_enabled:
393392
from ddtrace.data_streams import PROPAGATION_KEY_BASE_64
394393

395-
data_streams_ctx = (
396-
{PROPAGATION_KEY_BASE_64: dd_ctx[PROPAGATION_KEY_BASE_64]}
397-
if PROPAGATION_KEY_BASE_64 in dd_ctx
398-
else {}
399-
)
394+
if PROPAGATION_KEY_BASE_64 in dd_ctx:
395+
data_streams_ctx = {
396+
PROPAGATION_KEY_BASE_64: dd_ctx[PROPAGATION_KEY_BASE_64]
397+
}
398+
400399
return propagator.extract(dd_ctx), data_streams_ctx.get
401400
except Exception as e:
402401
logger.debug("The trace extractor returned with error %s", e)

0 commit comments

Comments
 (0)