Fail zarr format specification requirements if format cannot be inferred#31
Merged
Conversation
add warning to report when validating remote datasets and storage_options are missing in dataset attributes
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.
Describe your changes
There are a few things about the current zarr format requirement checks that are brittle:
xr.Datasetto apply validation too, but unfortunatelyxarraydoes not set thestorage_optionsarguments anywhere on thexr.Datasetit returns whenxr.open_zarr() / xr.open_dataset()is called to open the dataset. Thesestorage_optionsare needed when we want to access the underlying store. As a hack the cli sets the storage-options onds.encoding['storage_options']. With this PR we now warn the caller ifstorage_optionsisn't defined onds.encodingif the zarr format requirement checks fail to find out either what the zarr version is or whether there is consolidated metadata.The motivation here is two-fold: 1) ensure that we are actually checking for the things the spec requires and 2) nudge the user to supply
storage_optionson the providedxr.Dataset.No change of dependencies required.
Issue Link
Partially resolves #2
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee