Skip to content

Commit 01894b8

Browse files
committed
remove aiofiles
1 parent 2f0ab07 commit 01894b8

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

metaflow/metaflow_runner.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import os
22
import sys
3-
import asyncio
3+
import time
44
import tempfile
5-
import aiofiles
65
from typing import Dict
76
from metaflow import Run
87
from metaflow.cli import start
98
from metaflow.click_api import MetaflowAPI
109
from metaflow.subprocess_manager import SubprocessManager, CommandManager
1110

1211

13-
async def read_from_file_when_ready(file_path):
14-
async with aiofiles.open(file_path, "r") as file_pointer:
15-
content = await file_pointer.read()
12+
def read_from_file_when_ready(file_path):
13+
with open(file_path, "r") as file_pointer:
14+
content = file_pointer.read()
1615
while not content:
17-
await asyncio.sleep(0.1)
18-
content = await file_pointer.read()
16+
time.sleep(0.1)
17+
content = file_pointer.read()
1918
return content
2019

2120

@@ -71,8 +70,8 @@ async def run(self, **kwargs):
7170
)
7271
command_obj = self.spm.get(pid)
7372

74-
flow_name = await read_from_file_when_ready(tfp_flow.name)
75-
run_id = await read_from_file_when_ready(tfp_run_id.name)
73+
flow_name = read_from_file_when_ready(tfp_flow.name)
74+
run_id = read_from_file_when_ready(tfp_run_id.name)
7675

7776
pathspec_components = (flow_name, run_id)
7877
run_object = Run("/".join(pathspec_components), _namespace_check=False)

0 commit comments

Comments
 (0)