Skip to content

Commit 8e0e193

Browse files
committed
Cleanup
1 parent 7a03e39 commit 8e0e193

File tree

3 files changed

+249
-339
lines changed

3 files changed

+249
-339
lines changed

temporalio/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6511,9 +6511,9 @@ async def fail_async_activity(self, input: FailAsyncActivityInput) -> None:
65116511
failure = temporalio.api.failure.v1.Failure()
65126512
await data_converter.encode_failure(input.error, failure)
65136513
last_heartbeat_details = (
6514-
None
6515-
if not input.last_heartbeat_details
6516-
else await data_converter.encode_wrapper(input.last_heartbeat_details)
6514+
await data_converter.encode_wrapper(input.last_heartbeat_details)
6515+
if input.last_heartbeat_details
6516+
else None
65176517
)
65186518
if isinstance(input.id_or_token, AsyncActivityIDReference):
65196519
await self._client.workflow_service.respond_activity_task_failed_by_id(

temporalio/converter.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,17 @@ class SerializationContext(ABC):
7272
Provides contextual information during serialization and deserialization operations.
7373
7474
Examples:
75-
7675
- In client code, when starting a workflow, or sending a signal/update/query to a workflow, or
7776
receiving the result of an update/query, or handling an exception from a workflow, the context
7877
type is :py:class:`WorkflowSerializationContext` and the workflow ID set of the target
7978
workflow will be set in the context.
80-
8179
- In workflow code, when operating on a payload being sent/received to/from a child workflow, or
8280
handling an exception from a child workflow, the context type is
8381
:py:class:`WorkflowSerializationContext` and the workflow ID is that of the child workflow,
8482
not of the currently executing (i.e. parent) workflow.
85-
8683
- In workflow code, when operating on a payload to be sent/received to/from an activity, the
8784
context type is :py:class:`ActivitySerializationContext` and the workflow ID is that of the
8885
currently-executing workflow. ActivitySerializationContext is also set on operations
89-
9086
"""
9187

9288
pass
@@ -407,11 +403,11 @@ def from_payloads(
407403

408404
def with_context(self, context: Optional[SerializationContext]) -> Self:
409405
"""Return a new instance with the given context."""
410-
instance = type(self).__new__(type(self))
411406
converters = [
412407
c.with_context(context) if isinstance(c, WithSerializationContext) else c
413408
for c in self.converters.values()
414409
]
410+
instance = type(self).__new__(type(self))
415411
CompositePayloadConverter.__init__(instance, *converters)
416412
return instance
417413

0 commit comments

Comments
 (0)