Check if zarr store supports consolidated metadata#10457
Check if zarr store supports consolidated metadata#10457TomNicholas merged 47 commits intopydata:mainfrom
Conversation
xarray/tests/test_backends.py
Outdated
| assert actual["var1"].encoding["chunks"] == (2, 2) | ||
|
|
||
|
|
||
| class NoConsolidatedMetadataSupportStore(WrapperStore[Store]): |
There was a problem hiding this comment.
TODO: I don't think I even want to try and define this class if zarr-python v3 is not installed
xarray/backends/zarr.py
Outdated
| missing_exc = zarr.errors.GroupNotFoundError | ||
|
|
||
| if _zarr_v3(): | ||
| if not store.supports_consolidated_metadata: |
There was a problem hiding this comment.
| if not store.supports_consolidated_metadata: | |
| if not getattr(store, "supports_consolidated_metadata", True): |
I think this will be needed for Zarr >3.0.0,<3.1.0
There was a problem hiding this comment.
Right - I had something like that then removed it 🤦
|
Thank you @maxrjones . Long term, I'd love to see the responsibility for managing the readonly flag removed from the abstract |
|
Thanks for the discussion everyone - I want to move any further discussion of this over to zarr-developers/zarr-python#3186, where I've raised @paraseba's suggestion as an issue. For now I think I have what I need to be able to finish this PR. |
|
So for this PR obviously there are failures here, but:
But that's it - then xarray should work with zarr |
….com/TomNicholas/xarray into check_supports_consolidated_metadata
for more information, see https://pre-commit.ci
|
Needed to support the addition of
.supports_consolidated_metadatain zarr-python upstream: zarr-developers/zarr-python#3119.whats-new.rstNew functions/methods are listed inapi.rst