Support zarr write_empty_chunks
for zarr-python 3 and up
#10177
Merged
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.
Prevent passing
write_empty_chunks
from raising an error. Prior to this PRDataset.to_zarr(...,write_empty_chunks=)
would raise:This seems like the shortest path to prevent this bug without changing the xarray api at all, in the future it might be good to better align the xarray api with the zarr api. I also added
order
to this fix for create array as it underwent a similar deprecation.@sotosoul I independently encountered this issue and set out to fix it, I hadn't seen the fix in your fork. Can you try this out and see if it fixes it for you.
Test Changes
The test that would have caught this issue was not enabled for zarr v3. I enabled it but had to make some modifications to have it work for both format 2 and 3. I did a few things
write_empty_chunks
zarr-developers/zarr-python#2931write_empty_chunks
with Zarr v3 #10056whats-new.rst
api.rst