From 4acb0f8ea898142bc11f5894157813eaf56ee395 Mon Sep 17 00:00:00 2001 From: Brent Champion Date: Sat, 4 Oct 2025 18:48:50 -0400 Subject: [PATCH 1/3] fix: rename wait options model from seconds to wait_seconds --- src/aws_durable_execution_sdk_python/lambda_service.py | 8 ++++++-- src/aws_durable_execution_sdk_python/operation/wait.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/aws_durable_execution_sdk_python/lambda_service.py b/src/aws_durable_execution_sdk_python/lambda_service.py index b438c6c..d8dd844 100644 --- a/src/aws_durable_execution_sdk_python/lambda_service.py +++ b/src/aws_durable_execution_sdk_python/lambda_service.py @@ -219,10 +219,14 @@ def to_dict(self) -> MutableMapping[str, Any]: @dataclass(frozen=True) class WaitOptions: - seconds: int = 0 + wait_seconds: int = 0 + + @classmethod + def from_dict(cls, data: MutableMapping[str, Any]) -> WaitOptions: + return cls(wait_seconds=data.get("WaitSeconds", 0)) def to_dict(self) -> MutableMapping[str, Any]: - return {"WaitSeconds": self.seconds} + return {"WaitSeconds": self.wait_seconds} @dataclass(frozen=True) diff --git a/src/aws_durable_execution_sdk_python/operation/wait.py b/src/aws_durable_execution_sdk_python/operation/wait.py index 84d891a..9890e33 100644 --- a/src/aws_durable_execution_sdk_python/operation/wait.py +++ b/src/aws_durable_execution_sdk_python/operation/wait.py @@ -43,7 +43,7 @@ def wait_handler( if not checkpointed_result.is_existent(): operation = OperationUpdate.create_wait_start( identifier=operation_identifier, - wait_options=WaitOptions(seconds=seconds), + wait_options=WaitOptions(wait_seconds=seconds), ) state.create_checkpoint(operation_update=operation) From d870b2d6b7ba3cb44a32c52a7bbe906f5d10cd2b Mon Sep 17 00:00:00 2001 From: Brent Champion Date: Mon, 6 Oct 2025 12:00:27 -0400 Subject: [PATCH 2/3] fix: update unit tests asserting seconds for WaitOptions --- tests/e2e/execution_int_test.py | 4 ++-- tests/lambda_service_test.py | 12 ++++++------ tests/operation/wait_test.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/e2e/execution_int_test.py b/tests/e2e/execution_int_test.py index 510ae48..f21daa9 100644 --- a/tests/e2e/execution_int_test.py +++ b/tests/e2e/execution_int_test.py @@ -306,7 +306,7 @@ def mock_checkpoint( assert second_checkpoint.operation_type is OperationType.WAIT assert second_checkpoint.action is OperationAction.START assert second_checkpoint.operation_id == "1-1" - assert second_checkpoint.wait_options.seconds == 1 + assert second_checkpoint.wait_options.wait_seconds == 1 mock_inside_child.assert_called_once_with(10, 20) @@ -391,7 +391,7 @@ def mock_checkpoint( assert checkpoint.operation_type is OperationType.WAIT assert checkpoint.action is OperationAction.START assert checkpoint.operation_id == "1" - assert checkpoint.wait_options.seconds == 1 + assert checkpoint.wait_options.wait_seconds == 1 def test_lambda_client_initialization(): diff --git a/tests/lambda_service_test.py b/tests/lambda_service_test.py index 0baff32..65ccdb1 100644 --- a/tests/lambda_service_test.py +++ b/tests/lambda_service_test.py @@ -315,7 +315,7 @@ def test_step_options_to_dict(): def test_wait_options_to_dict(): """Test WaitOptions.to_dict method.""" - options = WaitOptions(seconds=60) + options = WaitOptions(wait_seconds=60) result = options.to_dict() assert result == {"WaitSeconds": 60} @@ -394,7 +394,7 @@ def test_operation_update_to_dict_complete(): message="Test error", type="TestError", data=None, stack_trace=None ) step_options = StepOptions(next_attempt_delay_seconds=30) - wait_options = WaitOptions(seconds=60) + wait_options = WaitOptions(wait_seconds=60) callback_options = CallbackOptions( timeout_seconds=300, heartbeat_timeout_seconds=60 ) @@ -463,7 +463,7 @@ def test_operation_update_create_callback(): def test_operation_update_create_wait_start(): """Test OperationUpdate.create_wait_start factory method.""" - wait_options = WaitOptions(seconds=30) + wait_options = WaitOptions(wait_seconds=30) update = OperationUpdate.create_wait_start( OperationIdentifier("wait1", "parent1", "test_wait"), wait_options ) @@ -581,7 +581,7 @@ def test_operation_update_with_parent_id(): def test_operation_update_wait_and_invoke_types(): """Test OperationUpdate with WAIT and INVOKE operation types.""" # Test WAIT operation - wait_options = WaitOptions(seconds=30) + wait_options = WaitOptions(wait_seconds=30) wait_update = OperationUpdate( operation_id="wait_op", operation_type=OperationType.WAIT, @@ -1064,7 +1064,7 @@ def test_durable_service_client_protocol_stop(): def test_operation_update_create_wait(): """Test OperationUpdate factory method for WAIT operations.""" - wait_options = WaitOptions(seconds=30) + wait_options = WaitOptions(wait_seconds=30) update = OperationUpdate( operation_id="wait1", operation_type=OperationType.WAIT, @@ -1369,7 +1369,7 @@ def test_operation_update_complete_with_new_fields(): ) context_options = ContextOptions(replay_children=True) step_options = StepOptions(next_attempt_delay_seconds=30) - wait_options = WaitOptions(seconds=60) + wait_options = WaitOptions(wait_seconds=60) callback_options = CallbackOptions( timeout_seconds=300, heartbeat_timeout_seconds=60 ) diff --git a/tests/operation/wait_test.py b/tests/operation/wait_test.py index 569886c..17b9de9 100644 --- a/tests/operation/wait_test.py +++ b/tests/operation/wait_test.py @@ -57,7 +57,7 @@ def test_wait_handler_not_completed(): operation_type=OperationType.WAIT, action=OperationAction.START, sub_type=OperationSubType.WAIT, - wait_options=WaitOptions(seconds=30), + wait_options=WaitOptions(wait_seconds=30), ) mock_state.create_checkpoint.assert_called_once_with( operation_update=expected_operation @@ -85,7 +85,7 @@ def test_wait_handler_with_none_name(): operation_type=OperationType.WAIT, action=OperationAction.START, sub_type=OperationSubType.WAIT, - wait_options=WaitOptions(seconds=5), + wait_options=WaitOptions(wait_seconds=5), ) mock_state.create_checkpoint.assert_called_once_with( operation_update=expected_operation From 4404eea3d20f691563cb90014aa8bf8acb76bd2b Mon Sep 17 00:00:00 2001 From: Brent Champion Date: Mon, 6 Oct 2025 12:05:32 -0400 Subject: [PATCH 3/3] fix merge conflict --- tests/e2e/execution_int_test.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/e2e/execution_int_test.py b/tests/e2e/execution_int_test.py index 7c45d1c..fdbcff3 100644 --- a/tests/e2e/execution_int_test.py +++ b/tests/e2e/execution_int_test.py @@ -391,15 +391,3 @@ def mock_checkpoint( assert checkpoint.action is OperationAction.START assert checkpoint.operation_id == "1" assert checkpoint.wait_options.wait_seconds == 1 - - -def test_lambda_client_initialization(): - """Test initialization of real Lambda client with specified endpoint and region.""" - endpoint = "https://durable.durable-functions.devo.us-west-2.lambda.aws.a2z.com" - region = "us-west-2" - - client = LambdaClient.initialize_from_endpoint_and_region(endpoint, region) - - assert client is not None - assert client.client is not None - assert checkpoint.wait_options.seconds == 1