Skip to content

Commit ade9bfc

Browse files
committed
Fix event deserialisation when not from external execution
1 parent dcb8a32 commit ade9bfc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/swf_typed/_history.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,8 +1605,9 @@ def from_api(cls, data):
16051605
id=data["eventId"],
16061606
occured=data["eventTimestamp"],
16071607
cause=attrs.get("cause") and ExecutionTerminationCause(attrs["cause"]),
1608-
cancelling_execution=_executions.ExecutionId.from_api(
1608+
cancelling_execution=(
16091609
attrs.get("externalWorkflowExecution")
1610+
and _executions.ExecutionId.from_api(attrs["externalWorkflowExecution"])
16101611
),
16111612
cancel_decision_event_id=attrs.get("externalInitiatedEventId"),
16121613
)
@@ -1756,8 +1757,9 @@ def from_api(cls, data):
17561757
occured=data["eventTimestamp"],
17571758
signal_name=attrs["signalName"],
17581759
signal_input=attrs.get("input"),
1759-
signalling_execution=_executions.ExecutionId.from_api(
1760+
signalling_execution=(
17601761
attrs.get("externalWorkflowExecution")
1762+
and _executions.ExecutionId.from_api(attrs["externalWorkflowExecution"])
17611763
),
17621764
signal_decision_event_id=attrs.get("externalInitiatedEventId"),
17631765
)

0 commit comments

Comments
 (0)