Error in Zarr metadata while loading CMIP6 data

Hi,
I was trying to load CMIP6 data using xr.open_zarr but I am getting problem with the metadata.
The code is similar to what posted in the zarr gallery same was running three days ago.

The code is pasted below

zstore = df_ta_ncar.zstore.values[-1]
print(zstore)

mapper = fsspec.get_mapper(zstore)

#ds = xr.open_zarr(mapper, consolidated=True)
ds = xr.open_zarr(mapper,consolidated=True)
ds

The error message is

File ~/.conda/envs/ninja/lib/python3.10/site-packages/zarr/storage.py:2947, in ConsolidatedMetadataStore.init(self, store, metadata_key)
2944 self.store = Store._ensure_store(store)
2946 # retrieve consolidated metadata
→ 2947 meta = json_loads(self.store[metadata_key])
2949 # check format of consolidated metadata
2950 consolidated_format = meta.get(“zarr_consolidated_format”, None)

File ~/.conda/envs/ninja/lib/python3.10/site-packages/zarr/storage.py:1430, in FSStore.getitem(self, key)
1428 return self.map[key]
1429 except self.exceptions as e:
→ 1430 raise KeyError(key) from e

KeyError: ‘.zmetadata’

Any solution is appreciated Thank you.

Could you go a bit further in terms of sharing a reproducible example? Specifically, what is zstore? That will help us help you better.

1 Like