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
Draft
fix: honor use_consolidated_for_children, merge async attribute updates, cancel timed-out sync coroutines#4343d-v-b wants to merge 3 commits into
d-v-b wants to merge 3 commits into
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
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>
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.
🤖 AI text below 🤖
Summary
Five small, independent, backwards-compatible bugfixes in
Group,sync, storage and the GPU buffer, each with a regression test where CI can run one. Originally prototyped as d-v-b#190 and rebased onto currentmain.membersignoreduse_consolidated_for_childrenwhen the root has consolidated metadataAsyncGroup._membersshort-circuited to_members_consolidated()wheneverself.metadata.consolidated_metadata is not None, so the flag had no effect.Group.members(sync) also did not forward the flag, and_iter_members_deepdid not pass it on recursive calls. All three now honor and forward it. The docstrings previously stated that root consolidated metadata is "always used"; they now describe the new behaviour.src/zarr/core/group.pyGroup.update_attributes_asyncreplaced attributes instead of mergingIt called
replace(self.metadata, attributes=new_attributes)whileAsyncGroup.update_attributesandGroup.update_attributesboth merge. It now merges. An existing test that asserted the replace behaviour was updated.src/zarr/core/group.pysync()timeout left the coroutine runningOn timeout,
wait()returned the future inunfinishedbut nothing cancelled it, so the coroutine kept running on the IO thread.future.cancel()is now called before raisingTimeoutError.src/zarr/core/sync.pyDeprecation warning for
zarr.storage.default_compressorpointed at a removed config keyThe message recommended
array.v2_default_compressor.numeric, which was removed in 3.1.0. It now points at thecompressors=argument tozarr.create_array().src/zarr/storage/__init__.pyGPU
NDBuffer.create(fill_value=None)diverged from CPUThe GPU buffer used
cp.empty(uninitialised) when no fill value was given, while the CPU buffer usesnp.zeros. It now zero-fills to match. cupy is not available in standard CI; GPU CI should validate this.src/zarr/core/buffer/gpu.pyDropped from the original prototype
The
require_array(dtype=None)change was dropped: #4189 deliberately kept the float64 default and tests it.Test results
Pre-commit (ruff, mypy, numpydoc-validation, codespell) passes.
TODO
docs/user-guide/*.md(not applicable, bugfixes only)changes/🤖 Generated with Claude Code