From 2812c5c1a7992b0e31cf0c1ec45c6d4dafb1efe0 Mon Sep 17 00:00:00 2001 From: Gregory Lee Date: Tue, 6 Sep 2022 12:17:42 -0400 Subject: [PATCH 1/4] assertion on path not containing meta should be meta/ this avoids disallowing key names such as 'metabolite', for instance --- zarr/hierarchy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zarr/hierarchy.py b/zarr/hierarchy.py index 80da3ddbc6..241efc9a85 100644 --- a/zarr/hierarchy.py +++ b/zarr/hierarchy.py @@ -600,7 +600,7 @@ def _array_iter(self, keys_only, method, recurse): if self._version == 2: for key in sorted(listdir(self._store, self._path)): path = self._key_prefix + key - assert not path.startswith("meta") + assert not path.startswith("meta/") if contains_array(self._store, path): _key = key.rstrip("/") yield _key if keys_only else (_key, self[key]) @@ -615,7 +615,7 @@ def _array_iter(self, keys_only, method, recurse): if key.endswith(array_sfx): key = key[:-len(array_sfx)] path = self._key_prefix + key - assert not path.startswith("meta") + assert not path.startswith("meta/") if key.endswith('.group' + self._metadata_key_suffix): # skip group metadata keys continue From 7b46b3fc0c57526bd5bdc41d9ee10d87c2e9b0a4 Mon Sep 17 00:00:00 2001 From: Gregory Lee Date: Tue, 6 Sep 2022 12:22:07 -0400 Subject: [PATCH 2/4] remove meta check altogether from the v2 branch as it is v3-specific --- zarr/hierarchy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/zarr/hierarchy.py b/zarr/hierarchy.py index 241efc9a85..d60631ba65 100644 --- a/zarr/hierarchy.py +++ b/zarr/hierarchy.py @@ -600,7 +600,6 @@ def _array_iter(self, keys_only, method, recurse): if self._version == 2: for key in sorted(listdir(self._store, self._path)): path = self._key_prefix + key - assert not path.startswith("meta/") if contains_array(self._store, path): _key = key.rstrip("/") yield _key if keys_only else (_key, self[key]) From b9a1f72ce01736c3a2e55efd9548a3fc27d71477 Mon Sep 17 00:00:00 2001 From: Gregory Lee Date: Tue, 6 Sep 2022 12:54:44 -0400 Subject: [PATCH 3/4] update docs/release.rst --- docs/release.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/release.rst b/docs/release.rst index 2582c34e04..f69e0bc1b8 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -35,6 +35,9 @@ Bug fixes * Fix bug in LRUEStoreCache in which the current size wasn't reset on invalidation. By :user:`BGCMHou ` and :user:`Josh Moore ` :issue:`1076`, :issue:`1077`. +* Remove erroneous check that disallowed array keys starting with "meta". + By :user:`Gregory R. Lee `; :issue:`1105`. + Documentation ~~~~~~~~~~~~~ From 1cec9fcb39cd5a6d6f7d298bd2874fac0ca54d22 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Thu, 8 Sep 2022 08:30:27 +0200 Subject: [PATCH 4/4] Add test for #6853 --- fixture/meta/.zarray | 23 +++++++++++++++++++++++ fixture/meta/0.0 | Bin 0 -> 48 bytes zarr/tests/test_storage.py | 6 ++++++ 3 files changed, 29 insertions(+) create mode 100644 fixture/meta/.zarray create mode 100644 fixture/meta/0.0 diff --git a/fixture/meta/.zarray b/fixture/meta/.zarray new file mode 100644 index 0000000000..f265bb0674 --- /dev/null +++ b/fixture/meta/.zarray @@ -0,0 +1,23 @@ +{ + "chunks": [ + 2, + 2 + ], + "compressor": { + "blocksize": 0, + "clevel": 5, + "cname": "lz4", + "id": "blosc", + "shuffle": 1 + }, + "dimension_separator": ".", + "dtype": "