Repository navigation
fix: accept must_understand=false extra fields in v3 group metadata - #4391
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4391 +/- ##
=======================================
Coverage 94.45% 94.46%
=======================================
Files 93 93
Lines 13224 13234 +10
=======================================
+ Hits 12491 12501 +10
Misses 733 733
🚀 New features to boost your workflow:
|
|
🤖 AI text below 🤖 The changelog fragment git mv changes/3523.bugfix.md changes/4391.bugfix.mdThis PR is planned for the 3.4.1 patch release. |
Share the extra-field checks between array and group metadata: `parse_extra_fields` takes the reserved keys, and the new `extract_extra_fields` splits and validates extra keys in `from_dict`. `GroupMetadata` now rejects extra fields that collide with its own keys, refuses extra fields on Zarr format 2 groups, and no longer passes a v2 `.zgroup` key named `extra_fields` to its constructor. Rename the changelog fragment to the PR number. Assisted-by: ClaudeCode:claude-opus-5-5
Documentation build overview
11 files changed ·
|
Documentation build overview
|
…tructors `parse_extra_fields` now also checks that every extra field is an object with `"must_understand": false`, so `ArrayV3Metadata` and `GroupMetadata` can no longer be constructed with extra fields that their own `from_dict` would reject. `extract_extra_fields` delegates to it, leaving one place that validates extra fields. The Zarr format 2 group refusal is checked first so it keeps its own message. Assisted-by: ClaudeCode:claude-opus-5-5
`extract_extra_fields` filtered the reserved keys and then called `parse_extra_fields`, whose collision check could never fire from that path. Both `from_dict`s now do the filter inline and call `parse_extra_fields` directly, so one function owns the extra-field contract. Also tighten the changelog fragment, the `GROUP_METADATA_KEYS` docstring, and the stale repr comments. Assisted-by: ClaudeCode:claude-fable-5-1
|
I pushed a few refinements, thanks for this @anishmehta24 |
Resolves the import conflict in group.py with zarr-developers#4391: keep both import lines. Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Resolves the import conflict in group.py with zarr-developers#4391: keep both import lines. Assisted-by: ClaudeCode:claude-fable-5-1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Summary
Opening a v3 group whose zarr.json has an extra field like
"my_ext": {"must_understand": false}fails with a TypeError, even though the spec says those fields must be accepted. #3530 fixed this for arrays but not groups.Group metadata now keeps these fields in
extra_fieldsand writes them back out, same as arrays do. Any other unknown key raisesMetadataValidationError.Closes #3523
For reviewers
extra_fieldsis a new field onGroupMetadata. I kept it the same shape as the array one.Author attestation
TODO
docs/user-guide/*.mdchanges/