8000 rename functions and skip coverage for workaround we expect to remove · zarr-developers/zarr-python@e76a376 · GitHub
[go: up one dir, main page]

Skip to content

Commit e76a376

Browse files
committed
rename functions and skip coverage for workaround we expect to remove
1 parent 7afd797 commit e76a376

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

zarr/storage.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,8 +1329,9 @@ def __init__(self, url, normalize_keys=False, key_separator=None,
13291329
# https://github.com/zarr-developers/zarr-python/pull/911#discussion_r841926292
13301330
# Some fsspec implementations don't accept missing_exceptions.
13311331
# This is a workaround to avoid passing it in the most common scenarios.
1332+
# Remove this and add missing_exceptions to mapper_options when fsspec is released.
13321333
if missing_exceptions is not None:
1333-
mapper_options["missing_exceptions"] = missing_exceptions
1334+
mapper_options["missing_exceptions"] = missing_exceptions # pragma: no cover
13341335

13351336
if fs is None:
13361337
protocol, _ = fsspec.core.split_protocol(url)

zarr/tests/test_core.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,14 +2484,21 @@ def test_store_has_bytes_values(self):
24842484
pass
24852485

24862486

2487+
fsspec_mapper_kwargs = {
2488+
"check": True,
2489+
"create": True,
2490+
"missing_exceptions": None
2491+
}
2492+
2493+
24872494
@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec")
24882495
class TestArrayWithFSStore(TestArray):
24892496
@staticmethod
24902497
def create_array(read_only=False, **kwargs):
24912498
path = mkdtemp()
24922499
atexit.register(shutil.rmtree, path)
24932500
key_separator = kwargs.pop('key_separator', ".")
2494-
store = FSStore(path, key_separator=key_separator, auto_mkdir=True)
2501+
store = FSStore(path, key_separator=key_separator, auto_mkdir=True, **fsspec_mapper_kwargs)
24952502
cache_metadata = kwargs.pop('cache_metadata', True)
24962503
cache_attrs = kwargs.pop('cache_attrs', True)
24972504
write_empty_chunks = kwargs.pop('write_empty_chunks', True)
@@ -2511,15 +2518,15 @@ def expected(self):
25112518

25122519

25132520
@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec")
2514-
class TestArrayWithFSStoreExistingFS(TestArray):
2521+
class TestArrayWithFSStoreFromFilesystem(TestArray):
25152522
@staticmethod
25162523
def create_array(read_only=False, **kwargs):
25172524
from fsspec.implementations.local import LocalFileSystem
25182525
fs = LocalFileSystem(auto_mkdir=True)
25192526
path = mkdtemp()
25202527
atexit.register(shutil.rmtree, path)
25212528
key_separator = kwargs.pop('key_separator', ".")
2522-
store = FSStore(path, fs=fs, key_separator=key_separator, create=True, check=True)
2529+
store = FSStore(path, fs=fs, key_separator=key_separator, **fsspec_mapper_kwargs)
25232530
cache_metadata = kwargs.pop('cache_metadata', True)
25242531
cache_attrs = kwargs.pop('cache_attrs', True)
25252532
write_empty_chunks = kwargs.pop('write_empty_chunks', True)
@@ -3165,7 +3172,12 @@ def create_array(array_path='arr1', read_only=False, **kwargs):
31653172
path = mkdtemp()
31663173
atexit.register(shutil.rmtree, path)
31673174
key_separator = kwargs.pop('key_separator', ".")
3168-
store = FSStoreV3(path, key_separator=key_separator, auto_mkdir=True)
3175+
store = FSStoreV3(
3176+
path,
3177+
key_separator=key_separator,
3178+
auto_mkdir=True,
3179+
**fsspec_mapper_kwargs
3180+
)
31693181
cache_metadata = kwargs.pop('cache_metadata', True)
31703182
cache_attrs = kwargs.pop('cache_attrs', True)
31713183
write_empty_chunks = kwargs.pop('write_empty_chunks', True)
@@ -3185,15 +3197,15 @@ def expected(self):
31853197

31863198

31873199
@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec")
3188-
class TestArrayWithFSStoreV3ExistingFS(TestArrayWithPathV3, TestArrayWithFSStore):
3200+
class TestArrayWithFSStoreV3FromFilesystem(TestArrayWithPathV3, TestArrayWithFSStore):
31893201
@staticmethod
31903202
def create_array(array_path='arr1', read_only=False, **kwargs):
31913203
from fsspec.implementations.local import LocalFileSystem
31923204
fs = LocalFileSystem(auto_mkdir=True)
31933205
path = mkdtemp()
31943206
atexit.register(shutil.rmtree, path)
31953207
key_separator = kwargs.pop('key_separator', ".")
3196-
store = FSStoreV3(path, fs=fs, key_separator=key_separator, create=True, check=True)
3208+
store = FSStoreV3(path, fs=fs, key_separator=key_separator, **fsspec_mapper_kwargs)
31973209
cache_metadata = kwargs.pop('cache_metadata', True)
31983210
cache_attrs = kwargs.pop('cache_attrs', True)
31993211
write_empty_chunks = kwargs.pop('write_empty_chunks', True)

0 commit comments

Comments
 (0)
0