aws-durable-execution-sdk-python-testing 1.1.0__py3-none-any.whl → 1.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aws_durable_execution_sdk_python_testing/__about__.py +1 -1
- aws_durable_execution_sdk_python_testing/__init__.py +3 -0
- aws_durable_execution_sdk_python_testing/execution.py +9 -9
- aws_durable_execution_sdk_python_testing/executor.py +5 -4
- aws_durable_execution_sdk_python_testing/invoker.py +31 -16
- aws_durable_execution_sdk_python_testing/model.py +32 -3
- aws_durable_execution_sdk_python_testing/runner.py +2 -3
- aws_durable_execution_sdk_python_testing/stores/filesystem.py +6 -31
- aws_durable_execution_sdk_python_testing/stores/sqlite.py +3 -13
- aws_durable_execution_sdk_python_testing/web/handlers.py +6 -0
- {aws_durable_execution_sdk_python_testing-1.1.0.dist-info → aws_durable_execution_sdk_python_testing-1.1.2.dist-info}/METADATA +2 -2
- {aws_durable_execution_sdk_python_testing-1.1.0.dist-info → aws_durable_execution_sdk_python_testing-1.1.2.dist-info}/RECORD +16 -16
- {aws_durable_execution_sdk_python_testing-1.1.0.dist-info → aws_durable_execution_sdk_python_testing-1.1.2.dist-info}/WHEEL +1 -1
- {aws_durable_execution_sdk_python_testing-1.1.0.dist-info → aws_durable_execution_sdk_python_testing-1.1.2.dist-info}/entry_points.txt +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.0.dist-info → aws_durable_execution_sdk_python_testing-1.1.2.dist-info}/licenses/LICENSE +0 -0
- {aws_durable_execution_sdk_python_testing-1.1.0.dist-info → aws_durable_execution_sdk_python_testing-1.1.2.dist-info}/licenses/NOTICE +0 -0
|
@@ -9,6 +9,8 @@ from aws_durable_execution_sdk_python_testing.runner import (
|
|
|
9
9
|
WebRunnerConfig,
|
|
10
10
|
)
|
|
11
11
|
|
|
12
|
+
from aws_durable_execution_sdk_python_testing.__about__ import __version__
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
__all__ = [
|
|
14
16
|
"DurableChildContextTestRunner",
|
|
@@ -17,4 +19,5 @@ __all__ = [
|
|
|
17
19
|
"DurableFunctionTestRunner",
|
|
18
20
|
"WebRunner",
|
|
19
21
|
"WebRunnerConfig",
|
|
22
|
+
"__version__",
|
|
20
23
|
]
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import json
|
|
4
3
|
from dataclasses import replace
|
|
5
4
|
from datetime import UTC, datetime
|
|
6
5
|
from enum import Enum
|
|
@@ -33,7 +32,6 @@ from aws_durable_execution_sdk_python_testing.model import (
|
|
|
33
32
|
)
|
|
34
33
|
from aws_durable_execution_sdk_python_testing.token import (
|
|
35
34
|
CheckpointToken,
|
|
36
|
-
CallbackToken,
|
|
37
35
|
)
|
|
38
36
|
|
|
39
37
|
|
|
@@ -96,15 +94,15 @@ class Execution:
|
|
|
96
94
|
durable_execution_arn=str(uuid4()), start_input=input, operations=[]
|
|
97
95
|
)
|
|
98
96
|
|
|
99
|
-
def
|
|
100
|
-
"""Serialize execution to dictionary
|
|
97
|
+
def to_json_dict(self) -> dict[str, Any]:
|
|
98
|
+
"""Serialize execution to JSON-serializable dictionary"""
|
|
101
99
|
return {
|
|
102
100
|
"DurableExecutionArn": self.durable_execution_arn,
|
|
103
101
|
"StartInput": self.start_input.to_dict(),
|
|
104
|
-
"Operations": [op.
|
|
102
|
+
"Operations": [op.to_json_dict() for op in self.operations],
|
|
105
103
|
"Updates": [update.to_dict() for update in self.updates],
|
|
106
104
|
"InvocationCompletions": [
|
|
107
|
-
completion.
|
|
105
|
+
completion.to_json_dict() for completion in self.invocation_completions
|
|
108
106
|
],
|
|
109
107
|
"UsedTokens": list(self.used_tokens),
|
|
110
108
|
"TokenSequence": self._token_sequence,
|
|
@@ -115,13 +113,15 @@ class Execution:
|
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
@classmethod
|
|
118
|
-
def
|
|
116
|
+
def from_json_dict(cls, data: dict[str, Any]) -> Execution:
|
|
119
117
|
"""Deserialize execution from dictionary."""
|
|
120
118
|
# Reconstruct start_input
|
|
121
119
|
start_input = StartDurableExecutionInput.from_dict(data["StartInput"])
|
|
122
120
|
|
|
123
121
|
# Reconstruct operations
|
|
124
|
-
operations = [
|
|
122
|
+
operations = [
|
|
123
|
+
Operation.from_json_dict(op_data) for op_data in data["Operations"]
|
|
124
|
+
]
|
|
125
125
|
|
|
126
126
|
# Create execution
|
|
127
127
|
execution = cls(
|
|
@@ -135,7 +135,7 @@ class Execution:
|
|
|
135
135
|
OperationUpdate.from_dict(update_data) for update_data in data["Updates"]
|
|
136
136
|
]
|
|
137
137
|
execution.invocation_completions = [
|
|
138
|
-
InvocationCompletedDetails.
|
|
138
|
+
InvocationCompletedDetails.from_json_dict(item)
|
|
139
139
|
for item in data.get("InvocationCompletions", [])
|
|
140
140
|
]
|
|
141
141
|
execution.used_tokens = set(data["UsedTokens"])
|
|
@@ -115,6 +115,7 @@ class Executor(ExecutionObserver):
|
|
|
115
115
|
execution = Execution.new(input=input)
|
|
116
116
|
execution.start()
|
|
117
117
|
self._store.save(execution)
|
|
118
|
+
logger.debug("Created execution with ARN: %s", execution.durable_execution_arn)
|
|
118
119
|
|
|
119
120
|
completion_event = self._scheduler.create_event()
|
|
120
121
|
self._completion_events[execution.durable_execution_arn] = completion_event
|
|
@@ -322,14 +323,14 @@ class Executor(ExecutionObserver):
|
|
|
322
323
|
|
|
323
324
|
Raises:
|
|
324
325
|
ResourceNotFoundException: If execution does not exist
|
|
325
|
-
ExecutionAlreadyStartedException: If execution is already completed
|
|
326
326
|
"""
|
|
327
327
|
execution = self.get_execution(execution_arn)
|
|
328
328
|
|
|
329
329
|
if execution.is_complete:
|
|
330
|
-
#
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
# Idempotent: return the existing stop timestamp
|
|
331
|
+
execution_op = execution.get_operation_execution_started()
|
|
332
|
+
stop_timestamp = execution_op.end_timestamp or datetime.now(UTC)
|
|
333
|
+
return StopDurableExecutionResponse(stop_timestamp=stop_timestamp)
|
|
333
334
|
|
|
334
335
|
# Use provided error or create a default one
|
|
335
336
|
stop_error = error or ErrorObject.from_message(
|
|
@@ -7,20 +7,23 @@ from typing import TYPE_CHECKING, Any, Protocol
|
|
|
7
7
|
from uuid import uuid4
|
|
8
8
|
|
|
9
9
|
import boto3 # type: ignore
|
|
10
|
+
from botocore.config import Config # type: ignore
|
|
11
|
+
|
|
10
12
|
from aws_durable_execution_sdk_python.execution import (
|
|
11
13
|
DurableExecutionInvocationInput,
|
|
12
14
|
DurableExecutionInvocationInputWithClient,
|
|
13
15
|
DurableExecutionInvocationOutput,
|
|
14
16
|
InitialExecutionState,
|
|
15
|
-
InvocationStatus,
|
|
16
17
|
)
|
|
17
18
|
|
|
18
19
|
from aws_durable_execution_sdk_python_testing.exceptions import (
|
|
19
20
|
DurableFunctionsTestError,
|
|
20
|
-
|
|
21
|
+
InvalidParameterValueException,
|
|
22
|
+
ResourceNotFoundException,
|
|
21
23
|
)
|
|
22
24
|
from aws_durable_execution_sdk_python_testing.model import LambdaContext
|
|
23
25
|
|
|
26
|
+
|
|
24
27
|
if TYPE_CHECKING:
|
|
25
28
|
from collections.abc import Callable
|
|
26
29
|
|
|
@@ -28,6 +31,26 @@ if TYPE_CHECKING:
|
|
|
28
31
|
from aws_durable_execution_sdk_python_testing.execution import Execution
|
|
29
32
|
|
|
30
33
|
|
|
34
|
+
# Max Lambda function timeout is 15 minutes (900s); we give headroom for
|
|
35
|
+
# network round-trip and RIE startup.
|
|
36
|
+
_LAMBDA_READ_TIMEOUT_SECONDS = 960
|
|
37
|
+
_LAMBDA_CLIENT_CONFIG = Config(
|
|
38
|
+
read_timeout=_LAMBDA_READ_TIMEOUT_SECONDS,
|
|
39
|
+
retries={"max_attempts": 0},
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def create_lambda_client(endpoint_url: str | None, region_name: str) -> Any:
|
|
44
|
+
"""Create a boto3 Lambda client configured for durable function invocations."""
|
|
45
|
+
|
|
46
|
+
return boto3.client(
|
|
47
|
+
"lambda",
|
|
48
|
+
endpoint_url=endpoint_url,
|
|
49
|
+
region_name=region_name,
|
|
50
|
+
config=_LAMBDA_CLIENT_CONFIG,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
31
54
|
@dataclass(frozen=True)
|
|
32
55
|
class InvokeResponse:
|
|
33
56
|
"""Response from invoking a durable function."""
|
|
@@ -135,9 +158,7 @@ class LambdaInvoker(Invoker):
|
|
|
135
158
|
@staticmethod
|
|
136
159
|
def create(endpoint_url: str, region_name: str) -> LambdaInvoker:
|
|
137
160
|
"""Create with the boto lambda client."""
|
|
138
|
-
invoker = LambdaInvoker(
|
|
139
|
-
boto3.client("lambda", endpoint_url=endpoint_url, region_name=region_name)
|
|
140
|
-
)
|
|
161
|
+
invoker = LambdaInvoker(create_lambda_client(endpoint_url, region_name))
|
|
141
162
|
invoker._current_endpoint = endpoint_url
|
|
142
163
|
invoker._endpoint_clients[endpoint_url] = invoker.lambda_client
|
|
143
164
|
return invoker
|
|
@@ -147,8 +168,8 @@ class LambdaInvoker(Invoker):
|
|
|
147
168
|
# Cache client by endpoint to reuse across executions
|
|
148
169
|
with self._lock:
|
|
149
170
|
if endpoint_url not in self._endpoint_clients:
|
|
150
|
-
self._endpoint_clients[endpoint_url] =
|
|
151
|
-
|
|
171
|
+
self._endpoint_clients[endpoint_url] = create_lambda_client(
|
|
172
|
+
endpoint_url, region_name
|
|
152
173
|
)
|
|
153
174
|
self.lambda_client = self._endpoint_clients[endpoint_url]
|
|
154
175
|
self._current_endpoint = endpoint_url
|
|
@@ -163,10 +184,8 @@ class LambdaInvoker(Invoker):
|
|
|
163
184
|
# Use provided endpoint or fall back to cached endpoint for this execution
|
|
164
185
|
if lambda_endpoint:
|
|
165
186
|
if lambda_endpoint not in self._endpoint_clients:
|
|
166
|
-
self._endpoint_clients[lambda_endpoint] =
|
|
167
|
-
"
|
|
168
|
-
endpoint_url=lambda_endpoint,
|
|
169
|
-
region_name=region_name or "us-east-1",
|
|
187
|
+
self._endpoint_clients[lambda_endpoint] = create_lambda_client(
|
|
188
|
+
lambda_endpoint, region_name or "us-east-1"
|
|
170
189
|
)
|
|
171
190
|
return self._endpoint_clients[lambda_endpoint]
|
|
172
191
|
|
|
@@ -219,10 +238,6 @@ class LambdaInvoker(Invoker):
|
|
|
219
238
|
InvalidParameterValueException: If parameters are invalid
|
|
220
239
|
DurableFunctionsTestError: For other invocation failures
|
|
221
240
|
"""
|
|
222
|
-
from aws_durable_execution_sdk_python_testing.exceptions import (
|
|
223
|
-
ResourceNotFoundException,
|
|
224
|
-
InvalidParameterValueException,
|
|
225
|
-
)
|
|
226
241
|
|
|
227
242
|
# Parameter validation
|
|
228
243
|
if not function_name or not function_name.strip():
|
|
@@ -239,7 +254,7 @@ class LambdaInvoker(Invoker):
|
|
|
239
254
|
response = client.invoke(
|
|
240
255
|
FunctionName=function_name,
|
|
241
256
|
InvocationType="RequestResponse", # Synchronous invocation
|
|
242
|
-
Payload=json.dumps(input.
|
|
257
|
+
Payload=json.dumps(input.to_json_dict()),
|
|
243
258
|
)
|
|
244
259
|
|
|
245
260
|
# Check HTTP status code
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import datetime
|
|
6
|
+
import json
|
|
6
7
|
from dataclasses import dataclass, replace
|
|
7
8
|
from enum import Enum
|
|
8
9
|
from typing import Any
|
|
9
|
-
import json
|
|
10
|
-
|
|
11
|
-
from dateutil.tz import UTC
|
|
12
10
|
|
|
13
11
|
from aws_durable_execution_sdk_python.execution import DurableExecutionInvocationOutput
|
|
14
12
|
|
|
@@ -30,12 +28,14 @@ from aws_durable_execution_sdk_python.lambda_service import (
|
|
|
30
28
|
OperationUpdate,
|
|
31
29
|
StepDetails,
|
|
32
30
|
StepOptions,
|
|
31
|
+
TimestampConverter,
|
|
33
32
|
WaitDetails,
|
|
34
33
|
WaitOptions,
|
|
35
34
|
)
|
|
36
35
|
from aws_durable_execution_sdk_python.types import (
|
|
37
36
|
LambdaContext as LambdaContextProtocol,
|
|
38
37
|
)
|
|
38
|
+
from dateutil.tz import UTC
|
|
39
39
|
|
|
40
40
|
from aws_durable_execution_sdk_python_testing.exceptions import (
|
|
41
41
|
InvalidParameterValueException,
|
|
@@ -1239,6 +1239,27 @@ class InvocationCompletedDetails:
|
|
|
1239
1239
|
request_id=data["RequestId"],
|
|
1240
1240
|
)
|
|
1241
1241
|
|
|
1242
|
+
@classmethod
|
|
1243
|
+
def from_json_dict(cls, data: dict) -> InvocationCompletedDetails:
|
|
1244
|
+
"""Deserialize from JSON dict with Unix millisecond timestamps."""
|
|
1245
|
+
start_ts: datetime.datetime | None = TimestampConverter.from_unix_millis(
|
|
1246
|
+
data["StartTimestamp"]
|
|
1247
|
+
) # type: ignore[arg-type]
|
|
1248
|
+
end_ts: datetime.datetime | None = TimestampConverter.from_unix_millis(
|
|
1249
|
+
data["EndTimestamp"]
|
|
1250
|
+
) # type: ignore[arg-type]
|
|
1251
|
+
|
|
1252
|
+
if start_ts is None or end_ts is None:
|
|
1253
|
+
raise InvalidParameterValueException(
|
|
1254
|
+
"StartTimestamp and EndTimestamp cannot be null"
|
|
1255
|
+
)
|
|
1256
|
+
|
|
1257
|
+
return cls(
|
|
1258
|
+
start_timestamp=start_ts,
|
|
1259
|
+
end_timestamp=end_ts,
|
|
1260
|
+
request_id=data["RequestId"],
|
|
1261
|
+
)
|
|
1262
|
+
|
|
1242
1263
|
def to_dict(self) -> dict[str, Any]:
|
|
1243
1264
|
return {
|
|
1244
1265
|
"StartTimestamp": self.start_timestamp,
|
|
@@ -1246,6 +1267,14 @@ class InvocationCompletedDetails:
|
|
|
1246
1267
|
"RequestId": self.request_id,
|
|
1247
1268
|
}
|
|
1248
1269
|
|
|
1270
|
+
def to_json_dict(self) -> dict[str, Any]:
|
|
1271
|
+
"""Convert to JSON-serializable dict with Unix millisecond timestamps."""
|
|
1272
|
+
return {
|
|
1273
|
+
"StartTimestamp": TimestampConverter.to_unix_millis(self.start_timestamp),
|
|
1274
|
+
"EndTimestamp": TimestampConverter.to_unix_millis(self.end_timestamp),
|
|
1275
|
+
"RequestId": self.request_id,
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1249
1278
|
|
|
1250
1279
|
# endregion event_structures
|
|
1251
1280
|
|
|
@@ -46,6 +46,7 @@ from aws_durable_execution_sdk_python_testing.executor import Executor
|
|
|
46
46
|
from aws_durable_execution_sdk_python_testing.invoker import (
|
|
47
47
|
InProcessInvoker,
|
|
48
48
|
LambdaInvoker,
|
|
49
|
+
create_lambda_client,
|
|
49
50
|
)
|
|
50
51
|
from aws_durable_execution_sdk_python_testing.model import (
|
|
51
52
|
GetDurableExecutionHistoryResponse,
|
|
@@ -858,9 +859,7 @@ class WebRunner:
|
|
|
858
859
|
Exception: If client creation fails - exceptions propagate naturally
|
|
859
860
|
for CLI to handle as general Exception
|
|
860
861
|
"""
|
|
861
|
-
|
|
862
|
-
return boto3.client(
|
|
863
|
-
"lambda",
|
|
862
|
+
return create_lambda_client(
|
|
864
863
|
endpoint_url=self._config.lambda_endpoint,
|
|
865
864
|
region_name=self._config.local_runner_region,
|
|
866
865
|
)
|
|
@@ -4,7 +4,6 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import json
|
|
6
6
|
import logging
|
|
7
|
-
from datetime import UTC, datetime
|
|
8
7
|
from pathlib import Path
|
|
9
8
|
|
|
10
9
|
from aws_durable_execution_sdk_python_testing.exceptions import (
|
|
@@ -16,30 +15,6 @@ from aws_durable_execution_sdk_python_testing.stores.base import (
|
|
|
16
15
|
)
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
class DateTimeEncoder(json.JSONEncoder):
|
|
20
|
-
"""Custom JSON encoder that handles datetime objects."""
|
|
21
|
-
|
|
22
|
-
def default(self, obj):
|
|
23
|
-
if isinstance(obj, datetime):
|
|
24
|
-
return obj.timestamp()
|
|
25
|
-
return super().default(obj)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def datetime_object_hook(obj):
|
|
29
|
-
"""JSON object hook to convert unix timestamps back to datetime objects."""
|
|
30
|
-
if isinstance(obj, dict):
|
|
31
|
-
for key, value in obj.items():
|
|
32
|
-
if isinstance(value, int | float) and key.endswith(
|
|
33
|
-
("_timestamp", "_time", "Timestamp", "Time")
|
|
34
|
-
):
|
|
35
|
-
try: # noqa: SIM105
|
|
36
|
-
obj[key] = datetime.fromtimestamp(value, tz=UTC)
|
|
37
|
-
except (ValueError, OSError):
|
|
38
|
-
# Leave as number if not a valid timestamp
|
|
39
|
-
pass
|
|
40
|
-
return obj
|
|
41
|
-
|
|
42
|
-
|
|
43
18
|
class FileSystemExecutionStore(BaseExecutionStore):
|
|
44
19
|
"""File system-based execution store for persistence."""
|
|
45
20
|
|
|
@@ -69,10 +44,10 @@ class FileSystemExecutionStore(BaseExecutionStore):
|
|
|
69
44
|
def save(self, execution: Execution) -> None:
|
|
70
45
|
"""Save execution to file system."""
|
|
71
46
|
file_path = self._get_file_path(execution.durable_execution_arn)
|
|
72
|
-
data = execution.
|
|
47
|
+
data = execution.to_json_dict()
|
|
73
48
|
|
|
74
49
|
with open(file_path, "w", encoding="utf-8") as f:
|
|
75
|
-
json.dump(data, f, indent=2
|
|
50
|
+
json.dump(data, f, indent=2)
|
|
76
51
|
|
|
77
52
|
def load(self, execution_arn: str) -> Execution:
|
|
78
53
|
"""Load execution from file system."""
|
|
@@ -82,9 +57,9 @@ class FileSystemExecutionStore(BaseExecutionStore):
|
|
|
82
57
|
raise ResourceNotFoundException(msg)
|
|
83
58
|
|
|
84
59
|
with open(file_path, encoding="utf-8") as f:
|
|
85
|
-
data = json.load(f
|
|
60
|
+
data = json.load(f)
|
|
86
61
|
|
|
87
|
-
return Execution.
|
|
62
|
+
return Execution.from_json_dict(data)
|
|
88
63
|
|
|
89
64
|
def update(self, execution: Execution) -> None:
|
|
90
65
|
"""Update execution in file system (same as save)."""
|
|
@@ -96,8 +71,8 @@ class FileSystemExecutionStore(BaseExecutionStore):
|
|
|
96
71
|
for file_path in self._storage_dir.glob("*.json"):
|
|
97
72
|
try:
|
|
98
73
|
with open(file_path, encoding="utf-8") as f:
|
|
99
|
-
data = json.load(f
|
|
100
|
-
executions.append(Execution.
|
|
74
|
+
data = json.load(f)
|
|
75
|
+
executions.append(Execution.from_json_dict(data))
|
|
101
76
|
except (json.JSONDecodeError, KeyError, OSError) as e:
|
|
102
77
|
logging.warning("Skipping corrupted file %s: %s", file_path, e)
|
|
103
78
|
continue
|
|
@@ -17,10 +17,6 @@ from aws_durable_execution_sdk_python_testing.execution import Execution
|
|
|
17
17
|
from aws_durable_execution_sdk_python_testing.stores.base import (
|
|
18
18
|
ExecutionStore,
|
|
19
19
|
)
|
|
20
|
-
from aws_durable_execution_sdk_python_testing.stores.filesystem import (
|
|
21
|
-
DateTimeEncoder,
|
|
22
|
-
datetime_object_hook,
|
|
23
|
-
)
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
class SQLiteExecutionStore(ExecutionStore):
|
|
@@ -102,7 +98,7 @@ class SQLiteExecutionStore(ExecutionStore):
|
|
|
102
98
|
execution_op.end_timestamp.timestamp()
|
|
103
99
|
if execution_op.end_timestamp
|
|
104
100
|
else None,
|
|
105
|
-
json.dumps(execution.
|
|
101
|
+
json.dumps(execution.to_json_dict()),
|
|
106
102
|
),
|
|
107
103
|
)
|
|
108
104
|
except sqlite3.Error as e:
|
|
@@ -125,9 +121,7 @@ class SQLiteExecutionStore(ExecutionStore):
|
|
|
125
121
|
if not row:
|
|
126
122
|
raise ResourceNotFoundException(f"Execution {execution_arn} not found")
|
|
127
123
|
|
|
128
|
-
return Execution.
|
|
129
|
-
json.loads(row[0], object_hook=datetime_object_hook)
|
|
130
|
-
)
|
|
124
|
+
return Execution.from_json_dict(json.loads(row[0]))
|
|
131
125
|
except sqlite3.Error as e:
|
|
132
126
|
raise RuntimeError(f"Failed to load execution {execution_arn}: {e}") from e
|
|
133
127
|
except json.JSONDecodeError as e:
|
|
@@ -222,11 +216,7 @@ class SQLiteExecutionStore(ExecutionStore):
|
|
|
222
216
|
executions: list[Execution] = []
|
|
223
217
|
for durable_execution_arn, data in rows:
|
|
224
218
|
try:
|
|
225
|
-
executions.append(
|
|
226
|
-
Execution.from_dict(
|
|
227
|
-
json.loads(data, object_hook=datetime_object_hook)
|
|
228
|
-
)
|
|
229
|
-
)
|
|
219
|
+
executions.append(Execution.from_json_dict(json.loads(data)))
|
|
230
220
|
except (json.JSONDecodeError, ValueError) as e:
|
|
231
221
|
# Log corrupted data but continue with other records
|
|
232
222
|
print(
|
|
@@ -291,16 +291,22 @@ class StartExecutionHandler(EndpointHandler):
|
|
|
291
291
|
Returns:
|
|
292
292
|
HTTPResponse: The HTTP response to send to the client
|
|
293
293
|
"""
|
|
294
|
+
logger.debug("🌟 HANDLER: Received POST /start-durable-execution request")
|
|
294
295
|
try:
|
|
295
296
|
body_data: dict[str, Any] = self._parse_json_body(request)
|
|
297
|
+
logger.debug("🌟 HANDLER: Parsed request body successfully")
|
|
296
298
|
|
|
297
299
|
start_input: StartDurableExecutionInput = (
|
|
298
300
|
StartDurableExecutionInput.from_dict(body_data)
|
|
299
301
|
)
|
|
302
|
+
logger.debug(
|
|
303
|
+
"🌟 HANDLER: Created StartDurableExecutionInput, calling executor.start_execution()"
|
|
304
|
+
)
|
|
300
305
|
|
|
301
306
|
start_output: StartDurableExecutionOutput = self.executor.start_execution(
|
|
302
307
|
start_input
|
|
303
308
|
)
|
|
309
|
+
logger.debug("🌟 HANDLER: executor.start_execution() returned successfully")
|
|
304
310
|
|
|
305
311
|
response_data: dict[str, Any] = start_output.to_dict()
|
|
306
312
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aws-durable-execution-sdk-python-testing
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: AWS Durable Execution Testing SDK for Python
|
|
5
5
|
Project-URL: Documentation, https://github.com/aws/aws-durable-execution-sdk-python-testing#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/aws/aws-durable-execution-sdk-python-testing/issues
|
|
7
7
|
Project-URL: Source, https://github.com/aws/aws-durable-execution-sdk-python-testing
|
|
8
|
-
Author-email:
|
|
8
|
+
Author-email: AWS durable-execution-dev <durable-execution-dev@amazon.com>
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
License-File: NOTICE
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
aws_durable_execution_sdk_python_testing/__about__.py,sha256=
|
|
2
|
-
aws_durable_execution_sdk_python_testing/__init__.py,sha256=
|
|
1
|
+
aws_durable_execution_sdk_python_testing/__about__.py,sha256=7qzc63t8OUhHP9YvXrUIRIK7LxcEvXL60VN7Z4b_y4M,137
|
|
2
|
+
aws_durable_execution_sdk_python_testing/__init__.py,sha256=NJnSWv9wZndxH7C0lBDVyQ61uhT6i79m5Z_u-PJCVxg,578
|
|
3
3
|
aws_durable_execution_sdk_python_testing/cli.py,sha256=ET2C3pYX_54BtV6GpLfP7FKkwOTgGoubPl0G9ixLmJk,18875
|
|
4
4
|
aws_durable_execution_sdk_python_testing/client.py,sha256=1CFuUXBZIkM7YOWwlJu4OrcjrJSTk01-Zc3N75kYSR4,1682
|
|
5
5
|
aws_durable_execution_sdk_python_testing/exceptions.py,sha256=ZgFPDtKgBn4-tj7fqaye901CksNQWL9RmMhgJBhEu_U,9110
|
|
6
|
-
aws_durable_execution_sdk_python_testing/execution.py,sha256=
|
|
7
|
-
aws_durable_execution_sdk_python_testing/executor.py,sha256=
|
|
8
|
-
aws_durable_execution_sdk_python_testing/invoker.py,sha256=
|
|
9
|
-
aws_durable_execution_sdk_python_testing/model.py,sha256=
|
|
6
|
+
aws_durable_execution_sdk_python_testing/execution.py,sha256=kU34EsVgtEPXQ8p4s-zjqhH38h0Gp9LxxyA16ofuwHI,17486
|
|
7
|
+
aws_durable_execution_sdk_python_testing/executor.py,sha256=Q0ktkPa8OUUX8ky8pujmUfiiIRNyMIEPCagqdmOw008,48594
|
|
8
|
+
aws_durable_execution_sdk_python_testing/invoker.py,sha256=Glx9ZN9hRRO_94Skb_qp95Y-DYCdTOfRapmt_KJ5uaU,13494
|
|
9
|
+
aws_durable_execution_sdk_python_testing/model.py,sha256=xS6kHPEo4RdHph_rN8dVpQxZC0XzZJpYRLtbABe3A_U,121291
|
|
10
10
|
aws_durable_execution_sdk_python_testing/observer.py,sha256=32MOYOfrmlKRqbfTXTM7m22iT38U2oYLGUkp7ar4Kvw,4935
|
|
11
11
|
aws_durable_execution_sdk_python_testing/py.typed,sha256=DbCDcAirv769HS1ibzZLXq8VPazYf7JCkKSzj3ctudM,58
|
|
12
|
-
aws_durable_execution_sdk_python_testing/runner.py,sha256=
|
|
12
|
+
aws_durable_execution_sdk_python_testing/runner.py,sha256=RKjttyO-hb4o_JPvlpiXYi_2Znk6yAfrFN4zJ0vKyrY,42512
|
|
13
13
|
aws_durable_execution_sdk_python_testing/scheduler.py,sha256=yqKGu8r3OoqPaERpILVNCIwjhFRxGOKxk5u2QJyF-44,8551
|
|
14
14
|
aws_durable_execution_sdk_python_testing/token.py,sha256=5rUpWMMcfZUVdOX_ptukRYiIRDsOdUA7faHXNyDGJRU,1530
|
|
15
15
|
aws_durable_execution_sdk_python_testing/checkpoint/__init__.py,sha256=sPmvbGOTRrDUvjiQwxsN8jS7uEQhpobt84yzYLEHfhk,81
|
|
@@ -34,19 +34,19 @@ aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/step.p
|
|
|
34
34
|
aws_durable_execution_sdk_python_testing/checkpoint/validators/operations/wait.py,sha256=E6m_upz1qQ6vQPOpU7mht0i_bBLLqfBP0UMYhGQG00k,1626
|
|
35
35
|
aws_durable_execution_sdk_python_testing/stores/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
36
36
|
aws_durable_execution_sdk_python_testing/stores/base.py,sha256=LdvwrhRgY8yCjxvnT1yZX6manFGzg_wmHwshnE8tWCg,5454
|
|
37
|
-
aws_durable_execution_sdk_python_testing/stores/filesystem.py,sha256=
|
|
37
|
+
aws_durable_execution_sdk_python_testing/stores/filesystem.py,sha256=o9DJ18bThSl1QUpfR3nE_BffLHchslePpz2VxrvLrJI,2910
|
|
38
38
|
aws_durable_execution_sdk_python_testing/stores/memory.py,sha256=V9PQTU6r-EHUqWPRui8YnjvEpxnLKKJxvfteNK3kgBo,1076
|
|
39
|
-
aws_durable_execution_sdk_python_testing/stores/sqlite.py,sha256=
|
|
39
|
+
aws_durable_execution_sdk_python_testing/stores/sqlite.py,sha256=QvMY_BUyg3FAYNDzqQz7BMseGmCTlRLlPa0r02JYvMc,10822
|
|
40
40
|
aws_durable_execution_sdk_python_testing/web/__init__.py,sha256=S8pemv1lfMXK4Kp8MIOAPEDMaUQGt9MArobCJhUERxw,84
|
|
41
41
|
aws_durable_execution_sdk_python_testing/web/errors.py,sha256=8elkOXggINFhmfRFSPqu3XvD0msiJ2gd5GD86o7pTQU,340
|
|
42
|
-
aws_durable_execution_sdk_python_testing/web/handlers.py,sha256=
|
|
42
|
+
aws_durable_execution_sdk_python_testing/web/handlers.py,sha256=5_r6zaoaPujnNJohXQ_iPbXJJCR7vPMJfDT_fXr-VjI,29523
|
|
43
43
|
aws_durable_execution_sdk_python_testing/web/models.py,sha256=B4SKVcTculNsO4Qd53tqkPnwVxwguP5PjNgnWF7dp8o,8852
|
|
44
44
|
aws_durable_execution_sdk_python_testing/web/routes.py,sha256=AU9fMhuR0HF9fltNZ6TZMNOueQc8wEeNyJqoBpMctm0,19466
|
|
45
45
|
aws_durable_execution_sdk_python_testing/web/serialization.py,sha256=qN6qJNgEYVqRQD9uhHupJVxyZfz4sc8KzIwxEqVIEcI,7747
|
|
46
46
|
aws_durable_execution_sdk_python_testing/web/server.py,sha256=DQWwgyb_GKkHbFw_OYgPG1o7uIZ4-sG7F-GAUclLYu0,8853
|
|
47
|
-
aws_durable_execution_sdk_python_testing-1.1.
|
|
48
|
-
aws_durable_execution_sdk_python_testing-1.1.
|
|
49
|
-
aws_durable_execution_sdk_python_testing-1.1.
|
|
50
|
-
aws_durable_execution_sdk_python_testing-1.1.
|
|
51
|
-
aws_durable_execution_sdk_python_testing-1.1.
|
|
52
|
-
aws_durable_execution_sdk_python_testing-1.1.
|
|
47
|
+
aws_durable_execution_sdk_python_testing-1.1.2.dist-info/METADATA,sha256=WchFeXSbyfcodoypxrqTScDRwdrfqV2mk410VrSNo9s,8953
|
|
48
|
+
aws_durable_execution_sdk_python_testing-1.1.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
49
|
+
aws_durable_execution_sdk_python_testing-1.1.2.dist-info/entry_points.txt,sha256=fMm3DMHWb7k4-PSseaQ-BjUxNV_3Z7RyJaDVSwqnkEo,87
|
|
50
|
+
aws_durable_execution_sdk_python_testing-1.1.2.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
|
|
51
|
+
aws_durable_execution_sdk_python_testing-1.1.2.dist-info/licenses/NOTICE,sha256=1CkO1kwu3Q_OHYTj-d-yiBJA_lNN73a4zSntavaD4oc,67
|
|
52
|
+
aws_durable_execution_sdk_python_testing-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|