Support metadata_key in opening consolidated Zarr store
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Problem Description
I want to use xarray.open_zarr to open a Zarr store with consolidated metadata, using a different metadata key, but right now it doesn't seem possible. Zarr allows you to specify the location of that key using the metadata_key argument in zarr.open_consolidated (see: https://zarr.readthedocs.io/en/latest/api/convenience.html#zarr.convenience.open_consolidated), however there is no way to pass that argument to xarray right now. After browsing the source code I actually found a comment about this issue: https://github.com/pydata/xarray/blob/652dd3ca77dd19bbd1ab21fe556340c1904ec382/xarray/backends/zarr.py#L257
If it's just a matter of adding that key to the kwargs of xarray.open_zarr then it shouldn't be a problem for me to submit a PR for this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in xarray/backends/zarr.py around the comment at line 257 and trace how xarray.open_zarr reaches zarr.open_consolidated. Check the referenced Zarr API for metadata_key and confirm the option can be passed through open_zarr. Done means callers can select a non-default consolidated metadata key.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100