Skip to content

Commit 9507e19

Browse files
committed
wip debugging
1 parent 6ac38ea commit 9507e19

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/zarr/codecs/_v2.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ async def _decode_single(
4646
# special case object dtype, because incorrect handling can lead to
4747
# segfaults and other bad things happening
4848
if chunk_spec.dtype != object:
49+
print(chunk_spec.dtype, chunk.dtype)
4950
chunk = chunk.view(chunk_spec.dtype)
51+
print("worked")
52+
5053
elif chunk.dtype != object:
5154
# If we end up here, someone must have hacked around with the filters.
5255
# We cannot deal with object arrays unless there is an object

src/zarr/core/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def reset(self) -> None:
6666
"ndbuffer": "zarr.core.buffer.cpu.NDBuffer",
6767
"v2_dtype_kind_to_default_filters_and_compressor": {
6868
"biufcmM": ["zstd"],
69-
"OSUV": ["vlen-utf8"],
69+
"SV": ["vlen-bytes"],
70+
"OU": ["vlen-utf8"],
7071
},
7172
}
7273
],

tests/test_properties.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import hypothesis.extra.numpy as npst # noqa: E402
88
import hypothesis.strategies as st # noqa: E402
9-
from hypothesis import assume, given # noqa: E402
9+
from hypothesis import assume, given, reproduce_failure # noqa: E402
1010

1111
from zarr.testing.strategies import arrays, basic_indices, numpy_arrays, zarr_formats # noqa: E402
1212

tests/test_v2.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,19 @@ def test_v2_filters_codecs(filters: Any) -> None:
141141

142142
@pytest.mark.parametrize(
143143
"dtype_expected",
144-
[["b", "zstd"], ["i", "zstd"], ["f", "zstd"], ["|S1", "vlen-utf8"], ["|U1", "vlen-utf8"]],
144+
# [["b", "zstd"], ["i", "zstd"], ["f", "zstd"], ["|S1", "vlen-utf8"], ["|U1", "vlen-utf8"]],
145+
[["|S1", "vlen-bytes"]],
145146
)
146147
def test_default_filters_and_compressor(dtype_expected: Any) -> None:
147148
with config.set(
148149
{
149150
"v2_dtype_kind_to_default_filters_and_compressor": {
150151
"biufcmM": ["zstd"],
151-
"OSUV": ["vlen-utf8"],
152+
"OSUV": ["vlen-bytes"],
152153
},
153154
}
154155
):
155156
dtype, expected = dtype_expected
156-
arr = zarr.create(shape=(10,), path="foo", store={}, zarr_format=2, dtype=dtype)
157+
arr = zarr.create(shape=(3,), path="foo", store={}, zarr_format=2, dtype=dtype)
157158
assert arr.metadata.filters[0].codec_id == expected
158-
print(arr.metadata)
159+
arr[:] = np.array(["a", "bb", "ccc"], dtype=dtype)

0 commit comments

Comments
 (0)