Skip to content

Commit

Permalink
Fixed zarrs_reencode with --shard-shape doubly applying codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Jul 29, 2024
1 parent a2356ce commit 7197bf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Bump `zarrs` to 0.16.0

### Fixed
- Fixed `zarrs_reencode` with `--shard-shape` applying existing array-to-array and bytes-to-bytes codecs as both inner and outer codecs

## [0.5.3] - 2024-07-24

### Added
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,14 @@ pub fn get_array_builder_reencode<TStorage: ?Sized>(
array_to_bytes_codec,
bytes_to_bytes_codecs,
);
array_builder.array_to_array_codecs(vec![]);
array_builder.array_to_bytes_codec(Box::new(ShardingCodec::new(
chunk_shape.try_into().unwrap(),
inner_codecs,
index_codecs,
sharding::ShardingIndexLocation::End,
)));
array_builder.bytes_to_bytes_codecs(vec![]);
} else {
array_builder.array_to_array_codecs(array_to_array_codecs);
array_builder.array_to_bytes_codec(array_to_bytes_codec);
Expand Down

0 comments on commit 7197bf6

Please sign in to comment.