Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions changes/3100.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Zarr V2: allow fixed-length string arrays to be created without automatically inserting a
``Vlen-UT8`` codec in the array of filters. Fixed-length string arrays do not need this codec. This
change fixes regressions against Zarr Python 2.18.
8 changes: 0 additions & 8 deletions src/zarr/core/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,14 +768,6 @@ def _create_metadata_v2(

dtype = parse_dtype(dtype, zarr_format=2)

# inject VLenUTF8 for str dtype if not already present
if np.issubdtype(dtype, np.str_):
filters = filters or []
from numcodecs.vlen import VLenUTF8

if not any(isinstance(x, VLenUTF8) or x["id"] == "vlen-utf8" for x in filters):
filters = list(filters) + [VLenUTF8()]

return ArrayV2Metadata(
shape=shape,
dtype=np.dtype(dtype),
Expand Down