Skip to content

Commit e2811ca

Browse files
author
Martin Durant
committed
Fixes #649
1 parent 06450d0 commit e2811ca

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

zarr/convenience.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def open(store=None, mode='a', **kwargs):
7373
path = kwargs.get('path', None)
7474
# handle polymorphic store arg
7575
clobber = mode == 'w'
76-
store = normalize_store_arg(store, clobber=clobber)
76+
store = normalize_store_arg(store, clobber=clobber,
77+
storage_options=kwargs.pop("storage_options", {}))
7778
path = normalize_storage_path(path)
7879

7980
if mode in {'w', 'w-', 'x'}:

zarr/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ def _chunk_getitems(self, lchunk_coords, lchunk_selection, out, lout_selection,
16881688
out_is_ndarray = False
16891689

16901690
ckeys = [self._chunk_key(ch) for ch in lchunk_coords]
1691-
cdatas = self.chunk_store.getitems(ckeys)
1691+
cdatas = self.chunk_store.getitems(ckeys, on_error="omit")
16921692
for ckey, chunk_select, out_select in zip(ckeys, lchunk_selection, lout_selection):
16931693
if ckey in cdatas:
16941694
self._process_chunk(out, cdatas[ckey], chunk_select, drop_axes,

zarr/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ def _normalize_key(self, key):
10381038
key = '/'.join(bits + [end.replace('.', self.key_separator)])
10391039
return key.lower() if self.normalize_keys else key
10401040

1041-
def getitems(self, keys):
1041+
def getitems(self, keys, **kwargs):
10421042
keys = [self._normalize_key(key) for key in keys]
10431043
return self.map.getitems(keys, on_error="omit")
10441044

zarr/tests/test_storage.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,11 @@ def test_s3(self):
955955

956956
assert g.data[:].tolist() == [0, 1, 2, 3, 0, 0, 0, 0]
957957

958+
# test via convenience
959+
g = zarr.open("s3://test/out.zarr", mode='r',
960+
storage_options=self.s3so)
961+
assert g.data[:].tolist() == [0, 1, 2, 3, 0, 0, 0, 0]
962+
958963
@pytest.mark.usefixtures("s3")
959964
def test_s3_complex(self):
960965
import zarr

0 commit comments

Comments
 (0)