Skip to content

Commit 2a78e7e

Browse files
committed
Cleanup
1 parent b8ab990 commit 2a78e7e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

temporalio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,7 @@ async def report_cancellation(
28522852
)
28532853

28542854
# TODO(dan): should this return Self (requiring that the user's subclass has the same
2855-
# constructor signature)?
2855+
# constructor signature)? CompositePayloadConverter.with_context does.
28562856
def with_context(self, context: SerializationContext) -> AsyncActivityHandle:
28572857
"""Create a new AsyncActivityHandle with a different serialization context.
28582858

temporalio/converter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class SerializationContext(ABC):
8484
not of the currently executing (i.e. parent) workflow.
8585
- In workflow code, when operating on a payload to be sent/received to/from an activity, the
8686
context type is :py:class:`ActivitySerializationContext` and the workflow ID is that of the
87-
currently-executing workflow. ActivitySerializationContext is also set on operations
87+
currently-executing workflow. ActivitySerializationContext is also set on data converter
88+
operations in the activity context.
8889
"""
8990

9091
pass
@@ -438,6 +439,8 @@ def with_context(self, context: SerializationContext) -> Self:
438439
if not any_with_context:
439440
return self
440441

442+
# A user who has created a subclass with a non-nullary constructor must override this
443+
# method.
441444
new_instance = type(self)()
442445
new_instance._set_converters(*converters)
443446
return new_instance

temporalio/worker/_workflow_instance.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def _apply_resolve_nexus_operation(
957957
return
958958

959959
# We don't set a serialization context for nexus operations on the caller side because it is
960-
# not possible to do so on the handler side.
960+
# not possible to set the same context on the handler side.
961961
payload_converter, failure_converter = (
962962
self._context_free_payload_converter,
963963
self._context_free_failure_converter,
@@ -2091,7 +2091,7 @@ def _converters_with_context(
20912091
20922092
This plays a similar role to DataConverter._with_context, but operates on PayloadConverter
20932093
and FailureConverter only (since payload encoding/decoding is done by the worker, outside
2094-
the workflowsandbox).
2094+
the workflow sandbox).
20952095
"""
20962096
payload_converter = self._context_free_payload_converter
20972097
failure_converter = self._context_free_failure_converter
@@ -2101,7 +2101,6 @@ def _converters_with_context(
21012101
failure_converter = failure_converter.with_context(context)
21022102
return payload_converter, failure_converter
21032103

2104-
# _WorkflowInstanceImpl.get_pending_command_serialization_context
21052104
def get_payload_codec_with_context(
21062105
self,
21072106
payload_codec: temporalio.converter.PayloadCodec,
@@ -2430,8 +2429,6 @@ async def _signal_external_workflow(
24302429
done_fut = self.create_future()
24312430
command.signal_external_workflow_execution.seq = seq
24322431

2433-
# Set as pending with the target workflow ID for later context use
2434-
# Extract the workflow ID from the command
24352432
target_workflow_id = (
24362433
command.signal_external_workflow_execution.child_workflow_id
24372434
or command.signal_external_workflow_execution.workflow_execution.workflow_id

0 commit comments

Comments
 (0)