Skip to content

Commit

Permalink
[air] fix pyarrow lazy import (ray-project#37670)
Browse files Browse the repository at this point in the history
ray-project#35938 introduced a pyarrow typehint, though pyarrow is being lazily imported. 

Signed-off-by: Matthew Deng <matt@anyscale.com>
  • Loading branch information
matthewdeng authored and harborn committed Aug 17, 2023
1 parent 8091b39 commit 0ee6fd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/ray/air/_internal/remote_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ def is_non_local_path_uri(uri: str) -> bool:


# Cache fs objects. Map from cache_key --> timestamp, fs
_cached_fs: Dict[tuple, Tuple[float, pyarrow.fs.FileSystem]] = {}
_cached_fs: Dict[tuple, Tuple[float, "pyarrow.fs.FileSystem"]] = {}


def _get_cache(cache_key: tuple) -> Optional[pyarrow.fs.FileSystem]:
def _get_cache(cache_key: tuple) -> Optional["pyarrow.fs.FileSystem"]:
ts, fs = _cached_fs.get(cache_key, (0, None))
if not fs:
return None
Expand All @@ -155,7 +155,7 @@ def _get_cache(cache_key: tuple) -> Optional[pyarrow.fs.FileSystem]:
return fs


def _put_cache(cache_key: tuple, fs: pyarrow.fs.FileSystem):
def _put_cache(cache_key: tuple, fs: "pyarrow.fs.FileSystem"):
now = time.monotonic()
_cached_fs[cache_key] = (now, fs)

Expand Down

0 comments on commit 0ee6fd9

Please sign in to comment.