Skip to content

Commit

Permalink
Merge pull request #908 from dcs4cop/toniof-xxx-fix_tests
Browse files Browse the repository at this point in the history
adjusted tests to fsspec > 2023.10.0
  • Loading branch information
TonioF authored Oct 25, 2023
2 parents 6341b6f + 4e6249b commit ebe3eb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion xcube/core/byoa/fileset.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import fsspec
import fsspec.implementations.zip
from fsspec.implementations.local import LocalFileSystem

from xcube.core.byoa.constants import TEMP_FILE_PREFIX
from xcube.util.assertions import assert_given
Expand Down Expand Up @@ -66,7 +67,9 @@ def new(cls,
**(storage_params or {}))
except (ImportError, OSError) as e:
raise ValueError(f'Illegal file set {path!r}') from e
local_path = root if fs.protocol == 'file' else None
local_path = root \
if 'file' in fs.protocol or isinstance(fs, LocalFileSystem) \
else None
return _FileSetDetails(fs, root, local_path)

@property
Expand Down
2 changes: 1 addition & 1 deletion xcube/util/fspath.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def is_local_fs(fs: fsspec.AbstractFileSystem) -> bool:
"""
Check whether *fs* is a local filesystem.
"""
return fs.protocol == 'file' or isinstance(fs, LocalFileSystem)
return 'file' in fs.protocol or isinstance(fs, LocalFileSystem)


def get_fs_path_class(fs: fsspec.AbstractFileSystem) \
Expand Down

0 comments on commit ebe3eb9

Please sign in to comment.