Skip to content

fix: honor use_consolidated_for_children, merge async attribute updates, cancel timed-out sync coroutines - #4343

Draft
d-v-b wants to merge 3 commits into
zarr-developers:mainfrom
d-v-b:group-sync-misc-bugfixes
Draft

d-v-b wants to merge 3 commits into
zarr-developers:mainfrom
d-v-b:group-sync-misc-bugfixes

Conversation

@d-v-b

@d-v-b d-v-b commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Changes Group.members and AsyncGroup.members so use_consolidated_for_children=False bypasses loaded root consolidated metadata for that traversal, and forwards the option recursively and through the synchronous wrapper. This deliberately changes the previous documented behavior that a loaded root snapshot was always authoritative. It is distinct from the current d-v-b#190 branch, which preserves that behavior.

Also merges attributes in Group.update_attributes_async (returning a new group), requests cancellation after sync timeouts, corrects the default_compressor deprecation example to use a V2 array, and zero-fills GPU NDBuffer.create when fill_value=None to match the CPU implementation.

The require_array dtype change from the original prototype is absent. Cancellation is cooperative: requesting it cannot guarantee that arbitrary coroutine code stops immediately. GPU behavior still requires GPU execution to validate. Historical test counts in the previous description were not rerun during this factual audit.

…ribute updates, cancel timed-out sync coroutines

- `AsyncGroup.members`, `Group.members` and `_iter_members_deep` now honor
  and forward `use_consolidated_for_children`, instead of unconditionally
  short-circuiting to consolidated metadata when the root has it.
- `Group.update_attributes_async` merges new attributes into the existing
  ones, matching `Group.update_attributes` and `AsyncGroup.update_attributes`.
- `sync()` cancels the pending future when it times out instead of leaving
  the coroutine running on the IO thread.
- The `zarr.storage.default_compressor` deprecation warning no longer points
  at the removed `array.v2_default_compressor` config key.
- GPU `NDBuffer.create` zero-fills when no fill value is given, matching the
  CPU buffer.

Addresses B11, B12, B14, B15 and B16 of #181. B13
(`require_array(dtype=None)`) was dropped: zarr-developers#4189
deliberately kept the float64 default.

Assisted-by: ClaudeCode:claude-fable-5-1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.34%. Comparing base (ba883a5) to head (dfd2a2d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4343   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files          92       92           
  Lines       12935    12941    +6     
=======================================
+ Hits        12203    12209    +6     
  Misses        732      732           
Files with missing lines Coverage Δ
src/zarr/core/buffer/gpu.py 90.47% <100.00%> (+0.11%) ⬆️
src/zarr/core/group.py 95.54% <100.00%> (+0.01%) ⬆️
src/zarr/core/sync.py 94.28% <100.00%> (+0.05%) ⬆️
src/zarr/storage/__init__.py 95.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

d-v-b and others added 2 commits September 12, 2026 18:22
Also specify Zarr format 2 in the deprecated compressor migration example.

Assisted-by: Codex:GPT-6
…xercise the recursion fix

Address roborev findings on eff4c60:

- Rebuild the members-recursion test so a nested group really carries
  stale consolidated metadata (consolidate at a/b, then create a/b/c).
  The previous version passed with the `_iter_members_deep` change
  reverted.
- Rename the changelog fragment to the upstream PR number (4343).
- Narrow the `update_attributes_async` docstring: merge semantics match
  `Group.update_attributes`, but it returns a new `Group`.
- Reword the GPU zero-fill comment and assert zero-fill in the existing
  GPU buffer test.

Assisted-by: ClaudeCode:claude-fable-5-1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant