Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] creating a new array with path should create a root group node if it doesn't exist #2187

Closed
jhamman opened this issue Sep 15, 2024 · 1 comment
Labels
bug Potential issues with the zarr-python library
Milestone

Comments

@jhamman
Copy link
Member

jhamman commented Sep 15, 2024

Zarr version

3.0.0.alpha4

Numcodecs version

N/A

Python Version

3.11

Operating System

Local install

Installation

pip install -e .

Description

The current behavior on the v3 branch diverges from v2 when creating a new array w/ a path. In v2, zarr creates a root group node when creating a new array. But in v3, we only create the array node. This means that you can't do the following:

In [1]: import zarr

In [2]: foo = zarr.create(shape=(3, 1), path='foo', store='/Users/jhamman/workdir/test-store', mode='w')

In [3]: root = zarr.open_group(store='/Users/jhamman/workdir/test-store', mode='r')

In [4]: root['foo']

Steps to reproduce

examining the store contents after creating of the array explains the difference

in v2 👇

In [1]: import zarr

In [2]: x = zarr.create(shape=(3, 0), path='foo')

In [3]: list(x.store.keys())
Out[3]: ['.zgroup', 'foo/.zarray']

in v3 👇

In [1]: import zarr

In [2]: x = zarr.create(shape=(3, 0), path='foo')

In [3]: [_ async for _ in x.store.list()]
Out[3]: ['foo/zarr.json']

Additional output

xref: #2186, dask/dask#11388

@jhamman jhamman added bug Potential issues with the zarr-python library V3 labels Sep 15, 2024
@jhamman jhamman added this to the 3.0.0.beta milestone Sep 15, 2024
@jhamman
Copy link
Member Author

jhamman commented Oct 1, 2024

closed by #2262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Potential issues with the zarr-python library
Projects
Status: Done
Development

No branches or pull requests

1 participant