Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork366
Closed
Description
Zarr version
3.0.0a0
Numcodecs version
0.12.1
Python Version
3.10.12
Operating System
Linux
Installation
pip install zarr==3.0.0a0
Description
This is a downstream issue for Kerchunk.
In ZarrV2,BaseStore inherited fromMutableMapping which brought with it the ability tocopy() and callitems() on aBaseStore, which Kerchunk depended onhere.
In ZarrV3, neitherStorePath norStore arecopy()-able, and of course__iter__,__setitem__, and__getitem__ are not available to make it anything like aMutableMapping.
@martindurant do you think this is something Kerchunk should handle or should ZarrV3 preserve the behavior of stores?
Steps to reproduce
This is the definition of the function Kerchunk is calling:
fromzarr.store.coreimportMemoryStore,StorePathdef_encode_for_JSON(store):"""Make store JSON encodable"""fork,vinstore.copy().items():ifisinstance(v,list):continueelse:try:# minify JSONv=ujson.dumps(ujson.loads(v))except (ValueError,TypeError):passtry:store[k]=v.decode()ifisinstance(v,bytes)elsevexceptUnicodeDecodeError:store[k]="base64:"+base64.b64encode(v).decode()returnstore_encode_for_JSON(StorePath(MemoryStore(mode="w")))# Will throw
Additional output
No response