You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9677081
Browse filesBrowse the repository at this point in the historyBrowse files
fix: accept must_understand=false extra fields in v3 group metadata (#4391)
* fix: accept must_understand=false extra fields in v3 group metadata
Closes#3523
* fix(group): match array extra_fields validation and refuse v2 extras
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
* fix(metadata): reject non-conforming extra fields in v3 metadata constructors
`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
* refactor(metadata): inline the extra-field split into from_dict
`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
---------
Co-authored-by: Davis Vann Bennett <davis.v.bennett@gmail.com>
Zarr format 3 group metadata now accepts extra fields that are objects with `"must_understand": false`, as the specification requires, and writes them back unchanged; previously opening such a group raised `TypeError`. Extra fields of any other shape raise `MetadataValidationError`, both when reading a metadata document and when constructing `GroupMetadata` or `ArrayV3Metadata` directly. `GroupMetadata` exposes these fields as `extra_fields`, like `ArrayV3Metadata`.
0 commit comments