Skip to content

Commit ce0afe3

Browse files
committed
remove another vestigial use of to_dtype().itemsize()
1 parent 3a21845 commit ce0afe3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/zarr/core/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
ZDTypeLike,
7373
parse_data_type,
7474
)
75-
from zarr.core.dtype.common import HasItemSize
75+
from zarr.core.dtype.common import HasEndianness, HasItemSize
7676
from zarr.core.indexing import (
7777
BasicIndexer,
7878
BasicSelection,
@@ -4731,7 +4731,7 @@ def _parse_chunk_encoding_v3(
47314731
# TODO: ensure that the serializer is compatible with the ndarray produced by the
47324732
# array-array codecs. For example, if a sequence of array-array codecs produces an
47334733
# array with a single-byte data type, then the serializer should not specify endiannesss.
4734-
if isinstance(out_array_bytes, BytesCodec) and dtype.to_dtype().itemsize == 1:
4734+
if isinstance(out_array_bytes, BytesCodec) and not isinstance(dtype, HasEndianness):
47354735
# The default endianness in the bytescodec might not be None, so we need to replace it
47364736
out_array_bytes = replace(out_array_bytes, endian=None)
47374737
return out_array_array, out_array_bytes, out_bytes_bytes

0 commit comments

Comments
 (0)