Skip to content

fix: reject reserved Zarr v3 node names - #4551

Open
Duo-ee wants to merge 13 commits into
zarr-developers:mainfrom
Duo-ee:fix/v3-node-name-validation
Open

Duo-ee wants to merge 13 commits into
zarr-developers:mainfrom
Duo-ee:fix/v3-node-name-validation

Conversation

@Duo-ee

@Duo-ee Duo-ee commented Oct 22, 2026 •

Copy link
Copy Markdown

Summary

Fixes #4453 by rejecting Zarr v3 node names that are reserved by the format: names beginning with __, the exact name zarr.json, and names made only of periods. The validation runs before metadata is written, preventing hierarchies that cannot be discovered or reopened reliably. Zarr v2 behavior remains unchanged.

For reviewers

The two pyproject.toml files now preserve LF line endings; the default diff shows the single dependency-pin change in each file.

Please focus on the validation boundary across array creation, group creation, hierarchy creation, and metadata writes. The tests cover each reserved-name rule, nested paths, v2 compatibility, and the no-write-on-failure behavior.

Validation run locally:

  • pytest tests/test_group.py — 990 passed, 209 skipped
  • pytest tests/test_metadata/test_io.py tests/test_api.py tests/test_array.py — 2942 passed, 765 skipped
  • Changed-file mypy, Ruff, formatting, and applicable pre-commit hooks passed.

AI assistance was used to inspect the existing code path, draft the implementation and tests, and run the validation listed above. The PR author later stated in a follow-up comment that they personally reviewed and understood the final diff. The validation results above remain agent-executed.

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

TODO

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions on the current head: 52 successful, 3 skipped; all required checks passed.
  • Codecov on the current head reports all modified coverable lines covered; project coverage: 94.71%.

Validate node names before writing Zarr v3 metadata.
Keep the branch diff focused by preserving repository line endings.
Reject reserved Zarr v3 node names before metadata writes.
Cover array, group, hierarchy, and v2 compatibility cases.
Document the reserved-node-name validation change.
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.71%. Comparing base (f19c19c) to head (c323737).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4551   +/-   ##
=======================================
  Coverage   94.71%   94.71%           
=======================================
  Files          94       94           
  Lines       13663    13672    +9     
=======================================
+ Hits        12941    12950    +9     
  Misses        722      722           
Files with missing lines Coverage Δ
src/zarr/core/common.py 93.42% <100.00%> (+0.19%) ⬆️
src/zarr/core/group.py 95.68% <100.00%> (+<0.01%) ⬆️
src/zarr/core/metadata/io.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use the compatibility fix in mkdocstrings 1.0.8 so ReadTheDocs builds work with the current pymdownx.highlight API.
Use mkdocstrings 1.0.8, which handles the current pymdownx.highlight constructor API.
Use mkdocstrings 1.0.8, which handles the current pymdownx.highlight constructor API.
Preserve repository line endings after resolving the branch update.
@Duo-ee

Duo-ee commented Oct 22, 2026

Copy link
Copy Markdown
Author

Update: I have now personally reviewed and understand every change in the diff, and can explain why each is correct. The AI assistance and validation disclosures above remain accurate.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bugs turned up while creating the zarr-metadata type checker

1 participant