Skip to content

Commit

Permalink
feat: allow manually creating arrays with "must_understand": true
Browse files Browse the repository at this point in the history
Useful for extension testing
  • Loading branch information
LDeakin committed Feb 22, 2025
1 parent a39ab53 commit 85d88b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Breaking**: move the `zarrs::array::{data_type,fill_value}` modules into the `zarrs_data_type` crate
- Bump `lru` to 0.13
- Use codec identifiers in the example for `experimental_codec_names` remapping

### Fixed
- Error on `{Array,Group}::[async_]open[_opt]` with additional fields with `"must_understand": true`
- Allow `{Array,Group}::new_with_metadata()` and `{Array,Group}Builder` to create arrays with `"must_understand": true` additional fields
- `{Array,Group}::[async_]open[_opt]` continue to fail with additional fields with `"must_understand": true`

## [0.19.2] - 2025-02-13

Expand Down
20 changes: 1 addition & 19 deletions zarrs/src/array/array_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,25 +328,7 @@ impl ArrayBuilder {
.with_storage_transformers(self.storage_transformers.create_metadatas()),
);

Ok(Array {
storage,
path,
// shape: self.shape.clone(),
data_type: self.data_type.clone(),
chunk_grid: self.chunk_grid.clone(),
chunk_key_encoding: self.chunk_key_encoding.clone(),
fill_value: self.fill_value.clone(),
codecs: Arc::new(CodecChain::new(
self.array_to_array_codecs.clone(),
self.array_to_bytes_codec.clone(),
self.bytes_to_bytes_codecs.clone(),
)),
storage_transformers: self.storage_transformers.clone(),
// attributes: self.attributes.clone(),
dimension_names: self.dimension_names.clone(),
// additional_fields: self.additional_fields.clone(),
metadata: array_metadata,
})
Array::new_with_metadata(storage, path.as_str(), array_metadata)
}

/// Build into an [`Arc<Array>`].
Expand Down

0 comments on commit 85d88b9

Please sign in to comment.