Skip to content

Commit 83acfe6

Browse files
committed
Some cleanup, reset core
1 parent b1865e0 commit 83acfe6

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

temporalio/worker/_workflow_instance.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
WorkflowInboundInterceptor,
8080
WorkflowOutboundInterceptor,
8181
)
82-
from ..api.common.v1.message_pb2 import Payloads
8382

8483
logger = logging.getLogger(__name__)
8584

@@ -144,7 +143,7 @@ class WorkflowInstanceDetails:
144143
extern_functions: Mapping[str, Callable]
145144
disable_eager_activity_execution: bool
146145
worker_level_failure_exception_types: Sequence[Type[BaseException]]
147-
last_completion_result: Payloads
146+
last_completion_result: temporalio.api.common.v1.Payloads
148147

149148
class WorkflowInstance(ABC):
150149
"""Instance of a workflow that can handle activations."""
@@ -1690,14 +1689,12 @@ def workflow_set_current_details(self, details: str):
16901689
self._current_details = details
16911690

16921691
def workflow_last_completion_result(self, type_hint: Optional[Type]) -> Optional[Any]:
1693-
print("workflow_last_completion_result: ", self._last_completion_result, type(self._last_completion_result), "payload length:", len(self._last_completion_result.payloads))
16941692
if len(self._last_completion_result.payloads) == 0:
16951693
return None
16961694
elif len(self._last_completion_result.payloads) > 1:
16971695
warnings.warn(f"Expected single last completion result, got {len(self._last_completion_result.payloads)}")
16981696
return None
16991697

1700-
print("Payload:", self._last_completion_result.payloads[0])
17011698
return self._payload_converter.from_payload(self._last_completion_result.payloads[0], type_hint)
17021699

17031700
#### Calls from outbound impl ####
@@ -2780,10 +2777,7 @@ def _apply_schedule_command(
27802777
v.start_to_close_timeout.FromTimedelta(self._input.start_to_close_timeout)
27812778
if self._input.retry_policy:
27822779
self._input.retry_policy.apply_to_proto(v.retry_policy)
2783-
if self._input.summary:
2784-
command.user_metadata.summary.CopyFrom(
2785-
self._instance._payload_converter.to_payload(self._input.summary)
2786-
)
2780+
27872781
v.cancellation_type = cast(
27882782
temporalio.bridge.proto.workflow_commands.ActivityCancellationType.ValueType,
27892783
int(self._input.cancellation_type),
@@ -2805,6 +2799,10 @@ def _apply_schedule_command(
28052799
command.schedule_activity.versioning_intent = (
28062800
self._input.versioning_intent._to_proto()
28072801
)
2802+
if self._input.summary:
2803+
command.user_metadata.summary.CopyFrom(
2804+
self._instance._payload_converter.to_payload(self._input.summary)
2805+
)
28082806
if self._input.priority:
28092807
command.schedule_activity.priority.CopyFrom(
28102808
self._input.priority._to_proto()

0 commit comments

Comments
 (0)