Skip to content

Commit

Permalink
add legacy vlen-utf8 codec
Browse files Browse the repository at this point in the history
  • Loading branch information
rabernat committed Jul 14, 2024
1 parent b8baa68 commit cb617f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/zarr/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ class NDBuffer:

def __init__(self, array: NDArrayLike):
# assert array.ndim > 0
assert array.dtype != object

# Commented this out because string arrays have dtype object
# TODO: decide how to handle strings (e.g. numpy 2.0 StringDtype)
# assert array.dtype != object
self._data = array

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions src/zarr/codecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from zarr.codecs.bytes import BytesCodec, Endian
from zarr.codecs.crc32c_ import Crc32cCodec
from zarr.codecs.gzip import GzipCodec
from zarr.codecs.legacy_vlen import VLenUTF8Codec
from zarr.codecs.pipeline import BatchedCodecPipeline
from zarr.codecs.sharding import ShardingCodec, ShardingCodecIndexLocation
from zarr.codecs.transpose import TransposeCodec
Expand All @@ -21,5 +22,6 @@
"ShardingCodec",
"ShardingCodecIndexLocation",
"TransposeCodec",
"VLenUTF8Codec",
"ZstdCodec",
]

0 comments on commit cb617f0

Please sign in to comment.