71
71
def _dsm_set_context_sqs_or_sns_event (event , event_type ):
72
72
for record in event .get ("Records" , [])[1 :]:
73
73
if arn := get_source_arn_sqs_or_sns (record , event_type ):
74
- context = extract_context_from_sqs_or_sns_record (record )
74
+ context = _extract_context_from_sqs_or_sns_record (record )
75
75
_dsm_set_checkpoint (context , event_type , arn )
76
76
77
77
78
78
def _dsm_set_context_kinesis_event (event ):
79
79
for record in event .get ("Records" , [])[1 :]:
80
80
if (arn := record .get ("eventSourceARN" )) and (kinesis := record .get ("kinesis" )):
81
- context = extract_context_from_kinesis_record (kinesis )
81
+ context = _extract_context_from_kinesis_record (kinesis )
82
82
_dsm_set_checkpoint (context , "kinesis" , arn )
83
83
84
84
@@ -272,7 +272,7 @@ def extract_context_from_sqs_or_sns_event_or_context(
272
272
try :
273
273
first_record = event .get ("Records" )[0 ]
274
274
source_arn = get_source_arn_sqs_or_sns (first_record , event_type )
275
- dd_data = extract_context_from_sqs_or_sns_record (first_record )
275
+ dd_data = _extract_context_from_sqs_or_sns_record (first_record )
276
276
if dd_data :
277
277
if is_step_function_event (dd_data ):
278
278
try :
@@ -322,7 +322,7 @@ def extract_context_from_sqs_or_sns_event_or_context(
322
322
return extract_context_from_lambda_context (lambda_context )
323
323
324
324
325
- def extract_context_from_sqs_or_sns_record (record ):
325
+ def _extract_context_from_sqs_or_sns_record (record ):
326
326
# logic to deal with SNS => SQS event
327
327
if "body" in record :
328
328
body_str = record .get ("body" )
@@ -428,7 +428,7 @@ def extract_context_from_kinesis_event(event, lambda_context):
428
428
kinesis = record .get ("kinesis" )
429
429
if not kinesis :
430
430
return extract_context_from_lambda_context (lambda_context )
431
- dd_ctx = extract_context_from_kinesis_record (kinesis )
431
+ dd_ctx = _extract_context_from_kinesis_record (kinesis )
432
432
if dd_ctx :
433
433
context = propagator .extract (dd_ctx )
434
434
_dsm_set_checkpoint (dd_ctx , "kinesis" , source_arn )
@@ -444,7 +444,7 @@ def extract_context_from_kinesis_event(event, lambda_context):
444
444
return extract_context_from_lambda_context (lambda_context )
445
445
446
446
447
- def extract_context_from_kinesis_record (record_kinesis_data ):
447
+ def _extract_context_from_kinesis_record (record_kinesis_data ):
448
448
data = record_kinesis_data .get ("data" )
449
449
if data :
450
450
import base64
0 commit comments