Skip to content

Different Objects Pointing at the Same store_path can have different metadata #2716

Open
@ilan-gold

Description

@ilan-gold

Zarr version

v3.0.0

Numcodecs version

0.14.1

Python Version

3.12

Operating System

Mac

Installation

uv

Description

Something very subtle appears to be going on here when doing something like my_group["/"] - previously in v2, this operation was idempotent in that my_group == my_group["/"].

I am not sure about how this sort of thing is actually supposed to work, or if the old behavior itself was buggy.

Steps to reproduce

v2/v3 code:

import zarr
z = zarr.open("foo.zarr")
z["/"].attrs.setdefault("foo", "bar")
assert z["/"].attrs.asdict() == { "foo": "bar" }
assert z.attrs.asdict() == { "foo": "bar" } # fails in v3
assert z["/"] == z # fails in v3

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