Skip to content

Commit 62c4fd2

Browse files
authored
Merge pull request #428 from botify-labs/fix-timestamps-handling-1
Revert "Remove obsolete int-to-datetime translation"
2 parents c3c615f + 3b1d595 commit 62c4fd2

File tree

1 file changed

+3
-1
lines changed
  • simpleflow/swf/mapper/models/event

1 file changed

+3
-1
lines changed

simpleflow/swf/mapper/models/event/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ def state(self) -> str:
9292

9393
@cached_property
9494
def timestamp(self) -> datetime:
95-
return self._timestamp.astimezone(pytz.UTC)
95+
if isinstance(self._timestamp, datetime):
96+
return self._timestamp.astimezone(pytz.UTC)
97+
return datetime.fromtimestamp(self._timestamp, tz=pytz.UTC)
9698

9799
@property
98100
def input(self) -> dict[str, Any]:

0 commit comments

Comments
 (0)