2222)
2323from aws_durable_execution_sdk_python .config import (
2424 ChildConfig ,
25- CheckpointMode ,
2625 NestingType ,
2726)
2827from aws_durable_execution_sdk_python .exceptions import (
@@ -138,6 +137,7 @@ class ConcurrentExecutor(ABC, Generic[CallableType, ResultType]):
138137
139138 def __init__ (
140139 self ,
140+ operation_identifier : OperationIdentifier ,
141141 executables : list [Executable [CallableType ]],
142142 max_concurrency : int | None ,
143143 completion_config : CompletionConfig ,
@@ -158,6 +158,7 @@ def __init__(
158158 handle large BatchResult payloads efficiently. Matches TypeScript behavior in
159159 run-in-child-context-handler.ts.
160160 """
161+ self .operation_identifier = operation_identifier
161162 self .executables = executables
162163 self .max_concurrency = max_concurrency
163164 self .completion_config = completion_config
@@ -412,17 +413,13 @@ def _execute_item_in_child_context(
412413 executable .index
413414 )
414415 name = f"{ self .name_prefix } { executable .index } "
415- child_context = executor_context .create_child_context (operation_id )
416+ non_virtual_parent_id = self .operation_identifier .operation_id if self .nesting_type is NestingType .FLAT else None
417+ child_context = executor_context .create_child_context (operation_id , non_virtual_parent_id )
416418 operation_identifier = OperationIdentifier (
417419 operation_id ,
418420 executor_context ._parent_id , # noqa: SLF001
419421 name ,
420422 )
421- checkpoint_mode = (
422- CheckpointMode .NO_CHECKPOINT
423- if self .nesting_type == NestingType .FLAT
424- else CheckpointMode .CHECKPOINT_AT_START_AND_FINISH
425- )
426423
427424 def run_in_child_handler ():
428425 return self .execute_item (child_context , executable )
@@ -435,7 +432,7 @@ def run_in_child_handler():
435432 serdes = self .item_serdes or self .serdes ,
436433 sub_type = self .sub_type_iteration ,
437434 summary_generator = self .summary_generator ,
438- checkpoint_mode = checkpoint_mode ,
435+ is_virtual = self . nesting_type is NestingType . FLAT ,
439436 ),
440437 )
441438 child_context .state .track_replay (operation_id = operation_id )
0 commit comments