Skip to content

Commit 9b1beb5

Browse files
Pass dimension_separator on fixture generation (fix #858) (#871)
* Pass dimension_separator on fixture generation (fix #858) Under some test conditions (conda-forge, Debian builds), the fixtures directory is not available and is then re-created. When dimension_separator is not passed to DirectoryStore, then no metadata is assigned to the file. For the "flat" (as opposed to "flat_legacy") fixture, this meant that the NestedDirectoryStore did not correct its behavior leading to a failure. see: - conda-forge/zarr-feedstock#56 - zarr-developers/zarr-python#858 * Revert "Pass dimension_separator on fixture generation (fix #858)" This reverts commit 6f79c56a3153f6f1a1d36a1a385b6af636a487d9. * Add a test for missing fixtures * Revert "Revert "Pass dimension_separator on fixture generation (fix #858)"" This reverts commit 568b1cf6175513a8c4916eaa09107e36854f53ad.
1 parent 6b13696 commit 9b1beb5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/minimal.yml

+7
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ jobs:
2626
conda activate minimal
2727
python -m pip install .
2828
pytest -svx
29+
- name: Fixture generation
30+
shell: "bash -l {0}"
31+
run: |
32+
conda activate minimal
33+
rm -rf fixture/
34+
pytest -svx zarr/tests/test_dim_separator.py zarr/tests/test_storage.py
35+
# This simulates fixture-less tests in conda and debian packaging

zarr/tests/test_dim_separator.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pytest
44
from numpy.testing import assert_array_equal
5+
from functools import partial
56

67
import zarr
78
from zarr.core import Array
@@ -43,9 +44,16 @@ def dataset(tmpdir, request):
4344
if not static.exists(): # pragma: no cover
4445

4546
if "nested" in which:
47+
# No way to reproduce the nested_legacy file via code
4648
generator = NestedDirectoryStore
4749
else:
48-
generator = DirectoryStore
50+
if "legacy" in suffix:
51+
# No dimension_separator metadata included
52+
generator = DirectoryStore
53+
else:
54+
# Explicit dimension_separator metadata included
55+
generator = partial(DirectoryStore,
56+
dimension_separator=".")
4957

5058
# store the data - should be one-time operation
5159
s = generator(str(static))

0 commit comments

Comments
 (0)