@@ -178,7 +178,7 @@ async def _handle_cancel_operation_task(
178
178
temporalio .nexus .current_context .set (
179
179
temporalio .nexus .Context (operation_context = ctx )
180
180
)
181
- # TODO(nexus-prerelease): header
181
+ # TODO(nexus-prerelease): headers
182
182
try :
183
183
await self ._handler .cancel_operation (ctx , request .operation_token )
184
184
except Exception as err :
@@ -219,6 +219,7 @@ async def _handle_start_operation_task(
219
219
220
220
try :
221
221
start_response = await self ._start_operation (start_request , headers )
222
+ # TODO(nexus-prerelease): handle BrokenExecutor by failing the worker
222
223
except BaseException as err :
223
224
handler_err = _exception_to_handler_error (err )
224
225
completion = temporalio .bridge .proto .nexus .NexusTaskCompletion (
@@ -235,7 +236,6 @@ async def _handle_start_operation_task(
235
236
236
237
try :
237
238
await self ._bridge_worker ().complete_nexus_task (completion )
238
- # TODO(nexus-prerelease): handle BrokenExecutor by failing the worker
239
239
except Exception :
240
240
temporalio .nexus .logger .exception ("Failed to send Nexus task completion" )
241
241
finally :
@@ -290,8 +290,8 @@ async def _start_operation(
290
290
async_success = temporalio .api .nexus .v1 .StartOperationResponse .Async (
291
291
operation_token = result .token ,
292
292
links = [
293
- temporalio .api .nexus .v1 .Link (url = l .url , type = l .type )
294
- for l in ctx .outbound_links
293
+ temporalio .api .nexus .v1 .Link (url = link .url , type = link .type )
294
+ for link in ctx .outbound_links
295
295
],
296
296
)
297
297
)
@@ -305,8 +305,9 @@ async def _start_operation(
305
305
else :
306
306
raise _exception_to_handler_error (
307
307
TypeError (
308
- "Operation start method must return either nexusrpc.handler.StartOperationResultSync "
309
- "or nexusrpc.handler.StartOperationResultAsync"
308
+ "Operation start method must return either "
309
+ "nexusrpc.handler.StartOperationResultSync or "
310
+ "nexusrpc.handler.StartOperationResultAsync."
310
311
)
311
312
)
312
313
except nexusrpc .handler .OperationError as err :
@@ -321,7 +322,6 @@ async def _exception_to_failure_proto(
321
322
api_failure = temporalio .api .failure .v1 .Failure ()
322
323
await self ._data_converter .encode_failure (err , api_failure )
323
324
api_failure = google .protobuf .json_format .MessageToDict (api_failure )
324
- # TODO(nexus-prerelease): is metadata correct and playing intended role here?
325
325
return temporalio .api .nexus .v1 .Failure (
326
326
message = api_failure .pop ("message" , "" ),
327
327
metadata = {"type" : "temporal.api.failure.v1.Failure" },
@@ -375,14 +375,14 @@ async def deserialize(
375
375
[self .payload ],
376
376
type_hints = [as_type ] if as_type else None ,
377
377
)
378
+ return input
378
379
except Exception as err :
379
380
raise nexusrpc .handler .HandlerError (
380
381
"Data converter failed to decode Nexus operation input" ,
381
382
type = nexusrpc .handler .HandlerErrorType .BAD_REQUEST ,
382
383
cause = err ,
383
384
retryable = False ,
384
385
) from err
385
- return input
386
386
387
387
388
388
# TODO(nexus-prerelease): tests for this function
0 commit comments