From 51d5f116c580cbda3eaa01552465a989cbfe9f43 Mon Sep 17 00:00:00 2001 From: Brandur Thorgrimsson Date: Wed, 22 Feb 2023 10:45:10 -0500 Subject: [PATCH 1/2] Fix creating a group with fsmap per issue #1353, regression test added --- zarr/hierarchy.py | 2 +- zarr/tests/test_hierarchy.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/zarr/hierarchy.py b/zarr/hierarchy.py index 0dae921500..18e7ac7863 100644 --- a/zarr/hierarchy.py +++ b/zarr/hierarchy.py @@ -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) diff --git a/zarr/tests/test_hierarchy.py b/zarr/tests/test_hierarchy.py index 7d87b6d404..d0833457fb 100644 --- a/zarr/tests/test_hierarchy.py +++ b/zarr/tests/test_hierarchy.py @@ -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 From a350f332feef2c294976d132d33967f3f41b67b5 Mon Sep 17 00:00:00 2001 From: Brandur Thorgrimsson Date: Thu, 23 Feb 2023 05:41:00 -0500 Subject: [PATCH 2/2] Update release notes --- docs/release.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/release.rst b/docs/release.rst index 0098d2e50b..a6c32100ba 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -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 ` :issue:`1354`. + .. _release_2.14.1: 2.14.1