File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ def _get_workflow_run_start_method_input_and_output_type_annotations(
57
57
Awaitable [WorkflowHandle [Any , O ]],
58
58
],
59
59
) -> tuple [
60
- Union [Type [I ], Type [ nexusrpc . handler . MISSING_TYPE ]],
61
- Union [Type [O ], Type [ nexusrpc . handler . MISSING_TYPE ]],
60
+ Optional [Type [I ]],
61
+ Optional [Type [O ]],
62
62
]:
63
63
"""Return operation input and output types.
64
64
@@ -76,15 +76,15 @@ def _get_workflow_run_start_method_input_and_output_type_annotations(
76
76
f"Expected return type of { start_method .__name__ } to be a subclass of WorkflowHandle, "
77
77
f"but is { output_type } "
78
78
)
79
- output_type = nexusrpc . handler . MISSING_TYPE
79
+ output_type = None
80
80
81
81
args = typing .get_args (output_type )
82
82
if len (args ) != 2 :
83
83
warnings .warn (
84
84
f"Expected return type of { start_method .__name__ } to have exactly two type parameters, "
85
85
f"but has { len (args )} : { args } "
86
86
)
87
- output_type = nexusrpc . handler . MISSING_TYPE
87
+ output_type = None
88
88
else :
89
89
_wf_type , output_type = args
90
90
return input_type , output_type
Original file line number Diff line number Diff line change @@ -371,12 +371,7 @@ async def deserialize(
371
371
try :
372
372
[input ] = await self .data_converter .decode (
373
373
[self .payload ],
374
- type_hints = ( # type: ignore
375
- [as_type ]
376
- # TODO(nexus-prerelease): HACK
377
- if (as_type and as_type != nexusrpc .handler .MISSING_TYPE )
378
- else [Any ]
379
- ),
374
+ type_hints = [as_type ] if as_type else None ,
380
375
)
381
376
except Exception as err :
382
377
raise nexusrpc .handler .HandlerError (
You can’t perform that action at this time.
0 commit comments