Skip to content

Commit

Permalink
Update for new RouterAsyncFS import/interface in recent Hail versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nawatts committed Jan 6, 2022
1 parent 9c8f089 commit 4320790
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gnomad/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
from typing import Callable, List, Dict, Optional, Tuple, Union

import hail as hl
from hailtop.aiotools import LocalAsyncFS, RouterAsyncFS, AsyncFS
from hailtop.aiotools import LocalAsyncFS, AsyncFS
from hailtop.aiogoogle import GoogleStorageAsyncFS
from hailtop.utils import bounded_gather, tqdm

try:
from hailtop.aiotools.router_fs import RouterAsyncFS
except ImportError:
from hailtop.aiotools import RouterAsyncFS

logging.basicConfig(format="%(levelname)s (%(name)s %(lineno)s): %(message)s")
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -57,7 +62,7 @@ async def async_file_exists(fs: AsyncFS, fpath: str) -> bool:
) as pbar:
with ThreadPoolExecutor() as thread_pool:
async with RouterAsyncFS(
"file", [LocalAsyncFS(thread_pool), GoogleStorageAsyncFS()]
"file", filesystems=[LocalAsyncFS(thread_pool), GoogleStorageAsyncFS()]
) as fs:

def check_existence_and_update_pbar_thunk(fpath: str) -> Callable:
Expand Down

0 comments on commit 4320790

Please sign in to comment.