File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/aws_durable_execution_sdk_python_testing/stores Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1717from aws_durable_execution_sdk_python_testing .stores .base import (
1818 ExecutionStore ,
1919)
20- from aws_durable_execution_sdk_python_testing .stores .filesystem import DateTimeEncoder
20+ from aws_durable_execution_sdk_python_testing .stores .filesystem import (
21+ DateTimeEncoder ,
22+ datetime_object_hook ,
23+ )
2124
2225
2326class SQLiteExecutionStore (ExecutionStore ):
@@ -122,7 +125,9 @@ def load(self, execution_arn: str) -> Execution:
122125 if not row :
123126 raise ResourceNotFoundException (f"Execution { execution_arn } not found" )
124127
125- return Execution .from_dict (json .loads (row [0 ]))
128+ return Execution .from_dict (
129+ json .loads (row [0 ], object_hook = datetime_object_hook )
130+ )
126131 except sqlite3 .Error as e :
127132 raise RuntimeError (f"Failed to load execution { execution_arn } : { e } " ) from e
128133 except json .JSONDecodeError as e :
@@ -217,7 +222,11 @@ def query(
217222 executions : list [Execution ] = []
218223 for durable_execution_arn , data in rows :
219224 try :
220- executions .append (Execution .from_dict (json .loads (data )))
225+ executions .append (
226+ Execution .from_dict (
227+ json .loads (data , object_hook = datetime_object_hook )
228+ )
229+ )
221230 except (json .JSONDecodeError , ValueError ) as e :
222231 # Log corrupted data but continue with other records
223232 print (
You can’t perform that action at this time.
0 commit comments