Skip to content

Commit f5ab161

Browse files
committed
Set wait_for_callback context subtype
1 parent bd83f17 commit f5ab161

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/context.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ def wait_in_child_context(context: DurableContext):
717717
return self.run_in_child_context(
718718
wait_in_child_context,
719719
step_name,
720+
ChildConfig(sub_type=OperationSubType.WAIT_FOR_CALLBACK),
720721
)
721722

722723
def wait_for_condition(

packages/aws-durable-execution-sdk-python/tests/context_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,7 @@ def test_wait_for_callback_basic(mock_executor_class):
11961196
# Verify the child context callable
11971197
call_args = mock_run_in_child.call_args
11981198
assert call_args[0][1] is None # name should be None
1199+
assert call_args[0][2].sub_type is OperationSubType.WAIT_FOR_CALLBACK
11991200

12001201

12011202
@patch("aws_durable_execution_sdk_python.context.wait_for_callback_handler")
@@ -1225,6 +1226,7 @@ def test_wait_for_callback_with_name_and_config(mock_executor_class):
12251226
assert (
12261227
call_args[0][1] == "submit_function"
12271228
) # name should be from _original_name
1229+
assert call_args[0][2].sub_type is OperationSubType.WAIT_FOR_CALLBACK
12281230

12291231

12301232
@patch("aws_durable_execution_sdk_python.context.wait_for_callback_handler")
@@ -1250,6 +1252,7 @@ def test_wait_for_callback_resolves_name_from_submitter(mock_executor_class):
12501252

12511253
call_args = mock_run_in_child.call_args
12521254
assert call_args[0][1] == "submit_task"
1255+
assert call_args[0][2].sub_type is OperationSubType.WAIT_FOR_CALLBACK
12531256

12541257

12551258
@patch("aws_durable_execution_sdk_python.context.wait_for_callback_handler")
@@ -1270,8 +1273,9 @@ def capture_handler_call(context, submitter, name, config):
12701273

12711274
with patch.object(DurableContext, "run_in_child_context") as mock_run_in_child:
12721275

1273-
def run_child_context(callable_func, name):
1276+
def run_child_context(callable_func, name, config):
12741277
# Execute the child context callable
1278+
assert config.sub_type is OperationSubType.WAIT_FOR_CALLBACK
12751279
child_context = create_test_context(state=mock_state, parent_id="test")
12761280
return callable_func(child_context)
12771281

0 commit comments

Comments
 (0)