Skip to content

Commit

Permalink
Hard-code .zmetadata in FSStore._normalize_key
Browse files Browse the repository at this point in the history
The normalization code in FSStore uses a list of well-known
files to prevent incorrectly re-writing keys when dimension
separator is "/" rather than ".". This was initialized only
with the names specified in the spec, which left out
".zmetadata" from consolidated metadata.

see: zarr-developers#1121
  • Loading branch information
joshmoore committed Jul 17, 2023
1 parent 1558041 commit a9b13a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,12 @@ def _normalize_key(self, key):
if key:
*bits, end = key.split('/')

if end not in (self._array_meta_key, self._group_meta_key, self._attrs_key):
if end not in (
self._array_meta_key,
self._group_meta_key,
self._attrs_key,
".zmetadata", # see: #1121
):
end = end.replace('.', self.key_separator)
key = '/'.join(bits + [end])

Expand Down

0 comments on commit a9b13a0

Please sign in to comment.