Skip to content

Commit 1d69594

Browse files
returning None is alright
1 parent b9283cd commit 1d69594

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

replit_river/codegen/client.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -919,10 +919,6 @@ def __init__(self, client: river.Client[Any]):
919919
parse_output_method = "lambda x: None"
920920

921921
if procedure.type == "rpc":
922-
control_flow_keyword = "return "
923-
if output_type == "None":
924-
control_flow_keyword = ""
925-
926922
current_chunks.extend(
927923
[
928924
reindent(
@@ -932,7 +928,7 @@ async def {name}(
932928
self,
933929
input: {render_type_expr(input_type)},
934930
) -> {render_type_expr(output_type)}:
935-
{control_flow_keyword}await self.client.send_rpc(
931+
return await self.client.send_rpc(
936932
{repr(schema_name)},
937933
{repr(name)},
938934
input,
@@ -967,9 +963,6 @@ async def {name}(
967963
]
968964
)
969965
elif procedure.type == "upload":
970-
control_flow_keyword = "return "
971-
if output_type == "None":
972-
control_flow_keyword = ""
973966
if init_type:
974967
assert render_init_method, "Expected an init renderer!"
975968
current_chunks.extend(
@@ -982,7 +975,7 @@ async def {name}(
982975
init: {init_type},
983976
inputStream: AsyncIterable[{render_type_expr(input_type)}],
984977
) -> {output_type}:
985-
{control_flow_keyword}await self.client.send_upload(
978+
return await self.client.send_upload(
986979
{repr(schema_name)},
987980
{repr(name)},
988981
init,
@@ -1006,7 +999,7 @@ async def {name}(
1006999
self,
10071000
inputStream: AsyncIterable[{render_type_expr(input_type)}],
10081001
) -> {render_type_expr(output_or_error_type)}:
1009-
{control_flow_keyword}await self.client.send_upload(
1002+
return await self.client.send_upload(
10101003
{repr(schema_name)},
10111004
{repr(name)},
10121005
None,

0 commit comments

Comments
 (0)