Skip to content

Commit

Permalink
fix: use bytes codec with native endianness if unset for a Zarr V2 …
Browse files Browse the repository at this point in the history
…array
  • Loading branch information
LDeakin committed Feb 5, 2025
1 parent fd10d56 commit 9d05d14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions zarrs_metadata/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Use `bytes` codec with native endianness if unset for a Zarr V2 array

## [0.3.2] - 2025-02-04

### Added
Expand Down
5 changes: 4 additions & 1 deletion zarrs_metadata/src/v2_to_v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub enum ArrayMetadataV2ToV3ConversionError {
///
/// # Errors
/// Returns a [`ArrayMetadataV2ToV3ConversionError`] if the metadata is invalid or is not compatible with Zarr V3 metadata.
#[allow(clippy::too_many_lines)]
pub fn codec_metadata_v2_to_v3(
order: ArrayMetadataV2Order,
dimensionality: usize,
Expand Down Expand Up @@ -148,7 +149,9 @@ pub fn codec_metadata_v2_to_v3(
if !has_array_to_bytes {
let bytes_metadata = MetadataV3::new_with_serializable_configuration(
crate::v3::array::codec::bytes::IDENTIFIER,
&BytesCodecConfigurationV1 { endian: endianness },
&BytesCodecConfigurationV1 {
endian: Some(endianness.unwrap_or(Endianness::native())),
},
)?;
codecs.push(bytes_metadata);
}
Expand Down

0 comments on commit 9d05d14

Please sign in to comment.