Uh oh!
There was an error while loading. Please reload this page.
Fill missing chunks - #3748
Conversation
tomwhite
commented
Mar 5, 2026
Thanks for doing this @williamsnell! |
d-v-b
commented
Mar 5, 2026
this is great @williamsnell! I'm wondering if this be exposed as part of the general array configuration, which is where |
williamsnell
commented
Mar 5, 2026
@d-v-b I've pushed a new commit moving this to One note: I'm not sure how this interacts with Sharding now - following the existing code I hardcoded |
d-v-b
commented
Mar 5, 2026
I don't think we want this new configuration option to change the behavior of the sharding codec. A missing subchunk inside a shard is conveyed explicitly via the shard index, so from the sharding codec's POV you can't have a subchunk appear missing due to a network error. |
If I've understood correctly, we'll want to make this tweak to def _get_chunk_spec(self, shard_spec: ArraySpec) -> ArraySpec:
+ # Because the shard index and inner chunks should be stored+ # together, we detect missing data via the shard index.+ # The inner chunks defined here are thus allowed to return+ # None, even if fill_missing_chunks=False at the array level.+ config = replace(shard_spec.config, fill_missing_chunks=True)
return ArraySpec(
shape=self.chunk_shape,
dtype=shard_spec.dtype,
fill_value=shard_spec.fill_value,
- config=shard_spec.config,+ config=config,
prototype=shard_spec.prototype,
)With this change, I think my previous point was wrong - we would be able to use |
example in zarr-python zarr-developers#486.
self.supports_partial_decode`.
expected behaviour of fill_missing_chunks for both sharding and write_empty_chunks via tests. Use elif to make control flow slightly clearer.
6db55a1 to
de7afd8Comparewilliamsnell
commented
Mar 6, 2026
I've committed the change to I've also made two more changes:
|
williamsnell
commented
Mar 11, 2026
Is there a way to run |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d-v-b
commented
Mar 11, 2026
a few suggestions about the error class, if it's OK with you @williamsnell I'd be happy pushing those changes to this branch? |
Go for it @d-v-b - thank you! |
d-v-b
commented
Apr 2, 2026
it's going in, thanks @williamsnell |
Uh oh!
There was an error while loading. Please reload this page.
Thank you all!! Great to have this merged 😁 (As a small aside, I was scrolling through PRs and noticed we might be able to close the oldest open PR in the repo: #489Allow disabling filling of missing chunks. Just thought this was cool - in any case, great to have this feature now!) |
Add config options for whether a missing chunk should:
fill_value(current behaviour; retained as default)MissingChunkErrorThis PR is entirely based on the work of @tomwhite in this issue. I've started this PR as this an important feature that I'd like to see merged.
I've added a test (based on the demo in the issue) and a minor docs tweak.
Questions:
config.md- is this the right place?TODO:
docs/user-guide/*.mdchanges/