-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Check if zarr store supports consolidated metadata #10457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if zarr store supports consolidated metadata #10457
Conversation
xarray/tests/test_backends.py
Outdated
@@ -3744,6 +3746,29 @@ def test_chunk_key_encoding_v2(self) -> None: | |||
assert actual["var1"].encoding["chunks"] == (2, 2) | |||
|
|||
|
|||
class NoConsolidatedMetadataSupportStore(WrapperStore[Store]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -1768,6 +1768,10 @@ def _get_open_params( | |||
else: | |||
missing_exc = zarr.errors.GroupNotFoundError | |||
|
|||
if _zarr_v3(): | |||
if not store.supports_consolidated_metadata: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right - I had something like that then removed it 🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in a47b2e2
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_metadata
in zarr-python upstream: zarr-developers/zarr-python#3119.whats-new.rst
New functions/methods are listed inapi.rst