Skip to content

Commit 2cd8df0

Browse files
committed
Use await task.aio(...) at the three in-tree sync-from-async call sites
1 parent 759f8ae commit 2cd8df0

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/advanced/local_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def noio_task():
101101
@env.task
102102
async def parallel_main_no_io(q: str) -> int:
103103
print("Starting parallel_main_no_io", flush=True)
104-
noio_task()
104+
await noio_task.aio()
105105
await input_trace("hello world", "blah", 42)
106106
a = await output_trace()
107107
await noio_trace()

examples/basics/dir_download_sync_repro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def download_directory_sync(d: Dir) -> list[str]:
4949
async def main() -> list[str]:
5050
remote_dir = await create_remote_directory()
5151
# Pass the Dir as an input to a sync task, which downloads it via download_sync().
52-
return download_directory_sync(d=remote_dir)
52+
return await download_directory_sync.aio(d=remote_dir)
5353

5454

5555
if __name__ == "__main__":

tests/flyte/local_controller/test_nested_hello_aio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def say_hello_nested(data: str = "default string") -> str:
2828

2929
squared = await asyncio.gather(*coros)
3030

31-
return say_hello(data=data, lt=squared)
31+
return await say_hello.aio(data=data, lt=squared)
3232

3333

3434
def test_run_local_controller():

0 commit comments

Comments
 (0)