Skip to content

Commit c8bf11a

Browse files
committed
make plugin_executor mandatory
1 parent c0fa533 commit c8bf11a

5 files changed

Lines changed: 81 additions & 17 deletions

File tree

src/aws_durable_execution_sdk_python/execution.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ def __init__(
260260
durable_execution_arn=self._invocation_input.durable_execution_arn,
261261
initial_checkpoint_token=self._invocation_input.checkpoint_token,
262262
operations={},
263+
plugin_executor=self._plugin_executor,
263264
service_client=self._service_client,
264265
replay_status=ReplayStatus.NEW,
265266
)
@@ -333,8 +334,8 @@ def execute(self):
333334
ThreadPoolExecutor(
334335
max_workers=2, thread_name_prefix="dex-handler"
335336
) as executor,
336-
contextlib.closing(self._execution_state),
337337
contextlib.closing(self._plugin_executor),
338+
contextlib.closing(self._execution_state),
338339
):
339340
# execute the plugins
340341
self._plugin_executor.on_invocation_start(

src/aws_durable_execution_sdk_python/state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def __init__(
241241
initial_checkpoint_token: str,
242242
operations: MutableMapping[str, Operation],
243243
service_client: DurableServiceClient,
244-
plugin_executor: PluginExecutor | None = None,
244+
plugin_executor: PluginExecutor,
245245
batcher_config: CheckpointBatcherConfig | None = None,
246246
replay_status: ReplayStatus = ReplayStatus.NEW,
247247
):

tests/e2e/map_with_concurrent_waits_int_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
OperationUpdate,
4343
OperationType,
4444
)
45+
from aws_durable_execution_sdk_python.plugin import PluginExecutor
4546
from aws_durable_execution_sdk_python.state import (
4647
CheckpointBatcherConfig,
4748
ExecutionState,
@@ -68,6 +69,7 @@ def _make_state(
6869
operations={},
6970
service_client=mock_client,
7071
batcher_config=config,
72+
plugin_executor=PluginExecutor([]),
7173
)
7274

7375

tests/logger_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def test_logger_with_log_info():
229229
initial_checkpoint_token="test_token", # noqa: S106
230230
operations={},
231231
service_client=Mock(),
232+
plugin_executor=PluginExecutor([]),
232233
)
233234
new_info = LogInfo(execution_state_new, "parent2", "op123", "new_name")
234235
new_logger = logger.with_log_info(new_info)
@@ -379,6 +380,7 @@ def test_logger_replay_no_logging():
379380
operations={"op1": operation},
380381
service_client=Mock(),
381382
replay_status=ReplayStatus.REPLAY,
383+
plugin_executor=PluginExecutor([]),
382384
)
383385
log_info = LogInfo(replay_execution_state, "parent123", "test_name", 5)
384386
mock_logger = Mock()
@@ -406,6 +408,7 @@ def test_logger_replay_then_new_logging():
406408
operations={"op1": operation1, "op2": operation2},
407409
service_client=Mock(),
408410
replay_status=ReplayStatus.REPLAY,
411+
plugin_executor=PluginExecutor([]),
409412
)
410413
log_info = LogInfo(execution_state, "parent123", "test_name", 5)
411414
mock_logger = Mock()

0 commit comments

Comments
 (0)