Description
ValueError: Invalid endianness: None. Expected one of ('little', 'big') or None, but I'd expect it it to work.
Steps to reproduce
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.12"
# dependencies = [
# # "cast-value-rs",
# "numpy",
# "zarr==3.2.0",
# ]
# ///
from __future__ import annotations
import tempfile
from pathlib import Path
import numpy as np
import zarr
from zarr.codecs import BytesCodec, CastValue
def main() -> None:
with tempfile.TemporaryDirectory() as tmpdir:
path = Path(tmpdir) / "cast_value_repro_invalid_endianness.zarr"
array = zarr.create_array(
path,
shape=(4,),
chunks=(4,),
dtype="int8",
fill_value=0,
filters=[CastValue(data_type="int16")],
serializer=BytesCodec(endian="little"),
compressors=[],
zarr_format=3,
overwrite=True,
)
array[:] = np.asarray([0, 1, 2, 3], dtype=np.int8)
_ = array[:]
if __name__ == "__main__":
main()
Description
ValueError: Invalid endianness: None. Expected one of ('little', 'big') or None, but I'd expect it it to work.Steps to reproduce