Skip to content

Commit 23244e0

Browse files
Nexus todo triage (#1269)
* Remove TODO comments marked as "Won't Do" in Nexus TODO triage This commit removes TODO comments from the codebase that were triaged and marked as "Won't Do" in the Nexus Python SDK TODO tracking document. These comments documented items that were decided not to be implemented or were already completed. Removed TODO comments from: - temporalio/worker/_activity.py (2 comments) - temporalio/workflow.py (1 comment) - temporalio/worker/_nexus.py (1 comment) - temporalio/nexus/_token.py (1 comment) - tests/nexus/test_workflow_caller.py (3 comments) Co-Authored-By: Claude Sonnet 4.5 <[email protected]> * After syncing with team, we're happy not inheriting from asyncio.Task for NexusOperationHandle * Remove unused self._interceptors variable in Nexus worker. Remove another todo --------- Co-authored-by: Claude Sonnet 4.5 <[email protected]>
1 parent 08e84a1 commit 23244e0

File tree

6 files changed

+0
-20
lines changed

6 files changed

+0
-20
lines changed

temporalio/nexus/_token.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def _to_client_workflow_handle(
4545
)
4646
return client.get_workflow_handle(self.workflow_id, result_type=result_type)
4747

48-
# TODO(nexus-preview): The return type here should be dictated by the input workflow
49-
# handle type.
5048
@classmethod
5149
def _unsafe_from_client_workflow_handle(
5250
cls, workflow_handle: temporalio.client.WorkflowHandle[Any, OutputT]

temporalio/worker/_activity.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ async def raise_from_exception_queue() -> NoReturn:
159159
)
160160
self._running_activities[task.task_token] = activity
161161
elif task.HasField("cancel"):
162-
# TODO(nexus-prerelease): does the task get removed from running_activities?
163162
self._handle_cancel_activity_task(task.task_token, task.cancel)
164163
else:
165164
raise RuntimeError(f"Unrecognized activity task: {task}")
@@ -190,9 +189,6 @@ async def drain_poll_queue(self) -> None:
190189

191190
# Only call this after run()/drain_poll_queue() have returned. This will not
192191
# raise an exception.
193-
# TODO(nexus-preview): based on the comment above it looks like the intention may have been to use
194-
# return_exceptions=True. Change this for nexus and activity and change call sites to consume entire
195-
# stream and then raise first exception
196192
async def wait_all_completed(self) -> None:
197193
running_tasks = [v.task for v in self._running_activities.values() if v.task]
198194
if running_tasks:

temporalio/worker/_nexus.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ def __init__(
7474
metric_meter: temporalio.common.MetricMeter,
7575
executor: concurrent.futures.ThreadPoolExecutor | None,
7676
) -> None:
77-
# TODO: make it possible to query task queue of bridge worker instead of passing
78-
# unused task_queue into _NexusWorker, _ActivityWorker, etc?
7977
self._bridge_worker = bridge_worker
8078
self._client = client
8179
self._task_queue = task_queue
@@ -91,8 +89,6 @@ def __init__(
9189
)
9290

9391
self._data_converter = data_converter
94-
# TODO(nexus-preview): interceptors
95-
self._interceptors = interceptors
9692

9793
self._running_tasks: dict[bytes, _RunningNexusTask] = {}
9894
self._fail_worker_exception_queue: asyncio.Queue[Exception] = asyncio.Queue()

temporalio/worker/_workflow_instance.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,9 +3253,6 @@ async def cancel(self) -> None:
32533253
await self._instance._cancel_external_workflow(command)
32543254

32553255

3256-
# TODO(nexus-preview): are we sure we don't want to inherit from asyncio.Task as
3257-
# ActivityHandle and ChildWorkflowHandle do? I worry that we should provide .done(),
3258-
# .result(), .exception() etc for consistency.
32593256
class _NexusOperationHandle(temporalio.workflow.NexusOperationHandle[OutputT]):
32603257
def __init__(
32613258
self,

temporalio/workflow.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5492,9 +5492,6 @@ async def execute_operation(
54925492
summary: str | None = None,
54935493
) -> OutputT: ...
54945494

5495-
# TODO(nexus-preview): in practice, both these overloads match an async def sync
5496-
# operation (i.e. either can be deleted without causing a type error).
5497-
54985495
# Overload for sync_operation methods (async def)
54995496
@overload
55005497
@abstractmethod

tests/nexus/test_workflow_caller.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
from tests.helpers.metrics import PromMetricMatcher
5555
from tests.helpers.nexus import create_nexus_endpoint, make_nexus_endpoint_name
5656

57-
# TODO(nexus-prerelease): test availability of Temporal client etc in async context set by worker
5857
# TODO(nexus-preview): test worker shutdown, wait_all_completed, drain etc
5958

6059
# -----------------------------------------------------------------------------
@@ -549,8 +548,6 @@ async def test_sync_response(
549548
task_queue=task_queue,
550549
)
551550

552-
# TODO(nexus-prerelease): check bidi links for sync operation
553-
554551
# The operation result is returned even when request_cancel=True, because the
555552
# response was synchronous and it could not be cancelled. See explanation below.
556553
if exception_in_operation_start:
@@ -628,7 +625,6 @@ async def test_async_response(
628625
)
629626
return
630627

631-
# TODO(nexus-prerelease): race here? How do we know it hasn't been canceled already?
632628
handler_wf_info = await handler_wf_handle.describe()
633629
assert handler_wf_info.status in [
634630
WorkflowExecutionStatus.RUNNING,

0 commit comments

Comments
 (0)