Skip to content

Commit 9d17da2

Browse files
returning None is alright
1 parent d553cf4 commit 9d17da2

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

replit_river/codegen/client.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def __init__(self, client: river.Client[{handshake_type}]):
584584
""".rstrip()
585585

586586
# Init renderer
587-
if typed_dict_inputs and init_type and procedure.init:
587+
if typed_dict_inputs and init_type:
588588
if is_literal(procedure.init):
589589
render_init_method = "lambda x: x"
590590
elif isinstance(
@@ -639,10 +639,6 @@ def __init__(self, client: river.Client[{handshake_type}]):
639639
parse_output_method = "lambda x: None"
640640

641641
if procedure.type == "rpc":
642-
control_flow_keyword = "return "
643-
if output_type == "None":
644-
control_flow_keyword = ""
645-
646642
current_chunks.extend(
647643
[
648644
reindent(
@@ -652,7 +648,7 @@ async def {name}(
652648
self,
653649
input: {input_type},
654650
) -> {output_type}:
655-
{control_flow_keyword}await self.client.send_rpc(
651+
return await self.client.send_rpc(
656652
{repr(schema_name)},
657653
{repr(name)},
658654
input,
@@ -687,9 +683,6 @@ async def {name}(
687683
]
688684
)
689685
elif procedure.type == "upload":
690-
control_flow_keyword = "return "
691-
if output_type == "None":
692-
control_flow_keyword = ""
693686
if init_type:
694687
current_chunks.extend(
695688
[
@@ -701,7 +694,7 @@ async def {name}(
701694
init: {init_type},
702695
inputStream: AsyncIterable[{input_type}],
703696
) -> {output_type}:
704-
{control_flow_keyword}await self.client.send_upload(
697+
return await self.client.send_upload(
705698
{repr(schema_name)},
706699
{repr(name)},
707700
init,
@@ -725,7 +718,7 @@ async def {name}(
725718
self,
726719
inputStream: AsyncIterable[{input_type}],
727720
) -> {output_or_error_type}:
728-
{control_flow_keyword}await self.client.send_upload(
721+
return await self.client.send_upload(
729722
{repr(schema_name)},
730723
{repr(name)},
731724
None,

0 commit comments

Comments
 (0)