Skip to content

Commit a79c87e

Browse files
committed
Make a pass through prerelease TODOs
1 parent 893447d commit a79c87e

14 files changed

+20
-58
lines changed

temporalio/nexus/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,3 @@
1414
from ._operation_context import logger as logger
1515
from ._operation_handlers import cancel_operation as cancel_operation
1616
from ._token import WorkflowHandle as WorkflowHandle
17-
18-
19-
# TODO(nexus-prerelease) WARN temporal_sdk_core::worker::nexus: Failed to parse nexus timeout header value '9.155416ms'
20-
# 2025-06-25T12:58:05.749589Z WARN temporal_sdk_core::worker::nexus: Failed to parse nexus timeout header value '9.155416ms'
21-
# 2025-06-25T12:58:05.763052Z WARN temporal_sdk_core::worker::nexus: Nexus task not found on completion. This may happen if the operation has already been cancelled but completed anyway. details=Status { code: NotFound, message: "Nexus task not found or already expired", details: b"\x08\x05\x12'Nexus task not found or already expired\x1aB\n@type.googleapis.com/temporal.api.errordetails.v1.NotFoundFailure", metadata: MetadataMap { headers: {"content-type": "application/grpc"} }, source: None }

temporalio/nexus/_operation_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def from_start_operation_context(
193193
)
194194

195195
# Overload for single-param workflow
196-
# TODO(nexus-prerelease): bring over other overloads
196+
# TODO(nexus-prerelease)*: bring over other overloads
197197
async def start_workflow(
198198
self,
199199
workflow: MethodAsyncSingleParam[SelfType, ParamType, ReturnType],

temporalio/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class MethodAsyncSingleParam(
8181
):
8282
"""Generic callable type."""
8383

84-
# TODO(nexus-prerelease): review changes to signatures in this file
84+
# TODO(nexus-prerelease)*: review changes to signatures in this file
8585
def __call__(
8686
self, __self: ProtocolSelfType, __arg: ProtocolParamType
8787
) -> Awaitable[ProtocolReturnType]:

temporalio/worker/_activity.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ async def drain_poll_queue(self) -> None:
201201

202202
# Only call this after run()/drain_poll_queue() have returned. This will not
203203
# raise an exception.
204-
# TODO(nexus-prerelease): based on the comment above it looks like the intention may have been to use
205-
# return_exceptions=True
204+
# TODO(nexus-preview): based on the comment above it looks like the intention may have been to use
205+
# return_exceptions=True. Change this for nexus and activity and change call sites to consume entire
206+
# stream and then raise first exception
206207
async def wait_all_completed(self) -> None:
207208
running_tasks = [v.task for v in self._running_activities.values() if v.task]
208209
if running_tasks:

temporalio/worker/_interceptor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ class StartNexusOperationInput(Generic[InputT, OutputT]):
304304
_operation_name: str = field(init=False, repr=False)
305305
_input_type: Optional[Type[InputT]] = field(init=False, repr=False)
306306

307-
# TODO(nexus-prerelease): update this logic to handle service impl start methods
308307
def __post_init__(self) -> None:
309308
if isinstance(self.operation, nexusrpc.Operation):
310309
self._operation_name = self.operation.name

temporalio/worker/_nexus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ async def _handle_cancel_operation_task(
191191
),
192192
)
193193
else:
194-
# TODO(nexus-prerelease): when do we use ack_cancel?
194+
# TODO(nexus-preview): ack_cancel completions?
195195
completion = temporalio.bridge.proto.nexus.NexusTaskCompletion(
196196
task_token=task_token,
197197
completed=temporalio.api.nexus.v1.Response(

temporalio/worker/_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def __init__(
311311
nexus_task_poller_behavior: Specify the behavior of Nexus task polling.
312312
Defaults to a 5-poller maximum.
313313
"""
314-
# TODO(nexus-prerelease): max_concurrent_nexus_tasks / tuner support
314+
# TODO(nexus-preview): max_concurrent_nexus_tasks / tuner support
315315
if not (activities or nexus_service_handlers or workflows):
316316
raise ValueError(
317317
"At least one activity, Nexus service, or workflow must be specified"

temporalio/worker/_workflow_instance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ def _apply_resolve_nexus_operation_start(
869869
# Note that core will still send a `ResolveNexusOperation` job in the same
870870
# activation, so there does not need to be an exceptional case for this in
871871
# lang.
872-
# TODO(nexus-prerelease): confirm appropriate to take no action here
872+
# TODO(nexus-preview): confirm appropriate to take no action here
873873
pass
874874
else:
875875
raise ValueError(f"Unknown Nexus operation start status: {job}")
@@ -3010,7 +3010,7 @@ def __init__(
30103010

30113011
@property
30123012
def operation_token(self) -> Optional[str]:
3013-
# TODO(nexus-prerelease): How should this behave?
3013+
# TODO(nexus-preview): How should this behave?
30143014
# Java has a separate class that only exists if the operation token exists:
30153015
# https://github.com/temporalio/sdk-java/blob/master/temporal-sdk/src/main/java/io/temporal/internal/sync/NexusOperationExecutionImpl.java#L26
30163016
# And Go similar:

temporalio/workflow.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4384,25 +4384,16 @@ async def execute_child_workflow(
43844384
return await handle
43854385

43864386

4387-
# TODO(nexus-prerelease): ABC / inherit from asyncio.Task?
43884387
class NexusOperationHandle(Generic[OutputT]):
43894388
def cancel(self) -> bool:
4390-
# TODO(nexus-prerelease): docstring
43914389
"""
4392-
Call task.cancel() on the asyncio task that is backing this handle.
4393-
4394-
From asyncio docs:
4395-
4396-
Cancel the future and schedule callbacks.
4397-
4398-
If the future is already done or cancelled, return False. Otherwise, change the future's state to cancelled, schedule the callbacks and return True.
4390+
Request cancellation of the operation.
43994391
"""
44004392
raise NotImplementedError
44014393

44024394
def __await__(self) -> Generator[Any, Any, OutputT]:
44034395
raise NotImplementedError
44044396

4405-
# TODO(nexus-prerelease): check SDK-wide consistency for @property vs nullary accessor methods.
44064397
@property
44074398
def operation_token(self) -> Optional[str]:
44084399
raise NotImplementedError

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ async def env(env_type: str) -> AsyncGenerator[WorkflowEnvironment, None]:
123123
],
124124
dev_server_download_version=DEV_SERVER_DOWNLOAD_VERSION,
125125
)
126+
# TODO(nexus-preview): expose this in a more principled way
126127
env._http_port = http_port # type: ignore
127128
elif env_type == "time-skipping":
128129
env = await WorkflowEnvironment.start_time_skipping()
129130
else:
130131
env = WorkflowEnvironment.from_client(await Client.connect(env_type))
131132

132-
# TODO(nexus-prerelease): expose this in a principled way
133133
yield env
134134
await env.shutdown()
135135

0 commit comments

Comments
 (0)