Repository navigation
fix: validate consolidated metadata listing keys and hierarchy - #4485
Open
barlowa124 wants to merge 2 commits into
Open
barlowa124 wants to merge 2 commits into
barlowa124 wants to merge 2 commits into
Conversation
barlowa124
added a commit
to barlowa124/zarr-python
that referenced
this pull request
Oct 7, 2026
barlowa124
force-pushed
the
consolidated-metadata-4453
branch
from
October 7, 2026 21:08
668c547 to
7b01078
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4485 +/- ##
=======================================
Coverage 94.69% 94.70%
=======================================
Files 94 94
Lines 13606 13626 +20
=======================================
+ Hits 12884 12904 +20
Misses 722 722
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the second item in #4453:
ConsolidatedMetadata.from_dict(andGroupMetadata.from_dict, which delegates to it) accepted consolidatedlistings the spec rules out, and two of them broke reads.
"",a//b) ora reserved segment (
.,..,zarr.json,__*) are now rejected withMetadataValidationErrorbefore any member is parsed.{"a/b": GROUP}used to raiseKeyError: 'a', which surfaced asGroupNotFoundErroronopen_group. The root group became unopenablebecause of one entry. It now fails with a clear
MetadataValidationError.A listing below an array (which
members()hit asKeyError) isrejected the same way.
The remaining #4453 items (float fill equality, fill-value edges,
document-level member validation) are untouched.
For reviewers
The stricter empty-segment rule is deliberate: consolidated keys are node
paths made of node names, and node names may not be empty. This differs
from #4484's name check, which skips empty segments so
"/foo"anda//bkeep their existing create-path normalization. If #4484 landsfirst this can reuse its helper for the reserved-name portion.
Scope check:
zarr_format: 2entries inside a v3 listing are stillaccepted; the issue lists it among the accepted-invalid cases but the
right handling for v2/v3 mixing is less clear-cut than the path rules, so
it is left out of this PR.
Author attestation
TODO
docs/user-guide/*.mdchanges/