Skip to content

Ensure zarr.group uses writable mode #1354

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

Merged
merged 2 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ Release notes
# .. warning::
# Pre-release! Use :command:`pip install --pre zarr` to evaluate this release.

.. _release_2.14.2:

2.14.2
------

Bug fixes
~~~~~~~~~

* Ensure ``zarr.group`` uses writeable mode to fix issue with :issue:`1304`.
By :user:`Brandur Thorgrimsson <swordcat>` :issue:`1354`.

.. _release_2.14.1:

2.14.1
Expand Down
2 changes: 1 addition & 1 deletion zarr/hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ def group(store=None, overwrite=False, chunk_store=None,
"""

# handle polymorphic store arg
store = _normalize_store_arg(store, zarr_version=zarr_version)
store = _normalize_store_arg(store, zarr_version=zarr_version, mode='w')
if zarr_version is None:
zarr_version = getattr(store, '_store_version', DEFAULT_ZARR_VERSION)

Expand Down
11 changes: 11 additions & 0 deletions zarr/tests/test_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,17 @@ def test_group(zarr_version):
assert store is g.store


@pytest.mark.skipif(have_fsspec is False, reason='needs fsspec')
@pytest.mark.parametrize('zarr_version', _VERSIONS)
def test_group_writeable_mode(zarr_version, tmp_path):
# Regression test for https://github.com/zarr-developers/zarr-python/issues/1353
import fsspec

store = fsspec.get_mapper(str(tmp_path))
zg = group(store=store)
assert zg.store.map == store


@pytest.mark.parametrize('zarr_version', _VERSIONS)
def test_open_group(zarr_version):
# test the open_group() convenience function
Expand Down