Skip to content

Commit 33fc029

Browse files
await
1 parent 64b4836 commit 33fc029

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

singlestoredb/functions/ext/asgi.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,14 @@ async def do_func(
320320

321321
# Call the function with `cols` as the function parameters
322322
if cols and cols[0]:
323-
out = func(*[x if m else x[0] for x, m in zip(cols, masks)])
323+
result = func(*[x if m else x[0] for x, m in zip(cols, masks)])
324324
else:
325-
out = func()
325+
result = func()
326+
327+
if inspect.iscoroutine(result):
328+
out = await result
329+
else:
330+
out = result
326331

327332
# Single masked value
328333
if isinstance(out, Masked):

0 commit comments

Comments
 (0)