Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stores are no longer MutableMappings #2023

Closed
Labels
bugPotential issues with the zarr-python library
@ghidalgo3

Description

@ghidalgo3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp