Skip to content

Commit b8921ac

Browse files
Alex Wangwangyb-A
authored andcommitted
fix(testing_lib): fix datetime decoder for filesystem
- use upper camel case as key in datetime object hook
1 parent 6954160 commit b8921ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/aws_durable_execution_sdk_python_testing/stores/filesystem.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def datetime_object_hook(obj):
2626
"""JSON object hook to convert unix timestamps back to datetime objects."""
2727
if isinstance(obj, dict):
2828
for key, value in obj.items():
29-
if isinstance(value, int | float) and key.endswith(("_timestamp", "_time")):
29+
if isinstance(value, int | float) and key.endswith(
30+
("_timestamp", "_time", "Timestamp", "Time")
31+
):
3032
try: # noqa: SIM105
3133
obj[key] = datetime.fromtimestamp(value, tz=UTC)
3234
except (ValueError, OSError):

0 commit comments

Comments
 (0)