We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fe16d6 commit 8bd6011Copy full SHA for 8bd6011
temporalio/nexus/handler.py
@@ -323,11 +323,16 @@ def workflow_run_operation(
323
def factory(service: S) -> WorkflowRunOperation[I, O, S]:
324
return WorkflowRunOperation(service, start_method)
325
326
- setattr(
327
- factory,
328
- "__nexus_operation__",
329
- nexusrpc.handler.NexusOperationDefinition(name=start_method.__name__),
+ type_annotations = typing.get_type_hints(start_method)
+ [output_type] = typing.get_args(type_annotations.pop("return"))
+ [input_type, _] = type_annotations.values()
+
330
+ factory.__nexus_operation__ = nexusrpc.handler.NexusOperationDefinition(
331
+ name=start_method.__name__,
332
+ input_type=input_type,
333
+ output_type=output_type,
334
)
335
336
return factory
337
338
0 commit comments