diff --git a/.github/workflows/minimal.yml b/.github/workflows/minimal.yml index b1705bdf98..0ce211cbde 100644 --- a/.github/workflows/minimal.yml +++ b/.github/workflows/minimal.yml @@ -24,5 +24,5 @@ jobs: shell: "bash -l {0}" run: | conda activate minimal - python -m pip install -e . + python -m pip install . pytest -svx diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d9bc362d12..9261187caf 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -57,7 +57,7 @@ jobs: python -m pip install --upgrade pip python -m pip install -U pip setuptools wheel codecov line_profiler python -m pip install -rrequirements_dev_minimal.txt numpy${{ matrix.numpy_version}} -rrequirements_dev_optional.txt pymongo redis - python -m pip install -e . + python -m pip install . python -m pip freeze - name: Tests shell: "bash -l {0}" diff --git a/.github/workflows/windows-testing.yml b/.github/workflows/windows-testing.yml index 0d746ced99..a4e20b7131 100644 --- a/.github/workflows/windows-testing.yml +++ b/.github/workflows/windows-testing.yml @@ -39,7 +39,7 @@ jobs: python -m pip install --upgrade pip python -m pip install -U pip setuptools wheel python -m pip install -r requirements_dev_numpy.txt -r requirements_dev_minimal.txt -r requirements_dev_optional.txt - python -m pip install -e . + python -m pip install . python -m pip freeze npm install -g azurite - name: Run Tests diff --git a/docs/release.rst b/docs/release.rst index d37516f8a6..6c814cbedb 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -6,6 +6,17 @@ Release notes Unreleased ---------- +.. _release_2.10.2: + +2.10.2 +------ + +Bug fixes +~~~~~~~~~ + +* Fix NestedDirectoryStore datasets without dimension_separator metadata. + By :user:`Josh Moore `; :issue:`850`. + .. _release_2.10.1: 2.10.1 diff --git a/fixture/flat/.zarray b/fixture/flat/.zarray index 8ec79419da..f265bb0674 100644 --- a/fixture/flat/.zarray +++ b/fixture/flat/.zarray @@ -10,6 +10,7 @@ "id": "blosc", "shuffle": 1 }, + "dimension_separator": ".", "dtype": " MappingType[str, Any]: else: object_codec = None + dimension_separator = meta.get('dimension_separator', None) fill_value = decode_fill_value(meta['fill_value'], dtype, object_codec) meta = dict( zarr_format=meta['zarr_format'], @@ -57,8 +58,9 @@ def decode_array_metadata(s: Union[MappingType, str]) -> MappingType[str, Any]: fill_value=fill_value, order=meta['order'], filters=meta['filters'], - dimension_separator=meta.get('dimension_separator', '.'), ) + if dimension_separator: + meta['dimension_separator'] = dimension_separator except Exception as e: raise MetadataError('error decoding metadata: %s' % e) diff --git a/zarr/tests/test_dim_separator.py b/zarr/tests/test_dim_separator.py index 566745e665..5e17bbe279 100644 --- a/zarr/tests/test_dim_separator.py +++ b/zarr/tests/test_dim_separator.py @@ -12,8 +12,10 @@ needs_fsspec = pytest.mark.skipif(not have_fsspec, reason="needs fsspec") -@pytest.fixture(params=("static_nested", - "static_flat", +@pytest.fixture(params=("static_flat", + "static_flat_legacy", + "static_nested", + "static_nested_legacy", "directory_nested", "directory_flat", "directory_default", @@ -35,14 +37,16 @@ def dataset(tmpdir, request): if which.startswith("static"): project_root = pathlib.Path(zarr.__file__).resolve().parent.parent - if which.endswith("nested"): - static = project_root / "fixture/nested" - generator = NestedDirectoryStore - else: - static = project_root / "fixture/flat" - generator = DirectoryStore + suffix = which[len("static_"):] + static = project_root / "fixture" / suffix if not static.exists(): # pragma: no cover + + if "nested" in which: + generator = NestedDirectoryStore + else: + generator = DirectoryStore + # store the data - should be one-time operation s = generator(str(static)) a = zarr.open(store=s, mode="w", shape=(2, 2), dtype="