diff --git a/changes/202.bugfix.md b/changes/202.bugfix.md new file mode 100644 index 0000000000..9c9bd40f21 --- /dev/null +++ b/changes/202.bugfix.md @@ -0,0 +1 @@ +Stop emitting an `UnstableSpecificationWarning` when serializing the `struct` data type to Zarr V3 metadata. The `struct` data type now has a stable Zarr V3 specification. The legacy `structured` alias and the unspecified `null_terminated_bytes`, `raw_bytes`, and `variable_length_bytes` data types continue to warn. diff --git a/src/zarr/core/dtype/npy/structured.py b/src/zarr/core/dtype/npy/structured.py index b865998e52..dcc523d1d2 100644 --- a/src/zarr/core/dtype/npy/structured.py +++ b/src/zarr/core/dtype/npy/structured.py @@ -589,7 +589,9 @@ def to_json(self, zarr_format: ZarrFormat) -> StructuredJSON_V2 | StructJSON_V3: ] return {"name": fields_v2, "object_codec_id": None} elif zarr_format == 3: - v3_unstable_dtype_warning(self) + # The "struct" data type has a stable Zarr V3 specification + # (https://github.com/zarr-developers/zarr-extensions/tree/main/data-types/struct), + # so unlike the legacy "structured" alias it does not emit an unstable-spec warning. fields_v3 = [ {"name": f_name, "data_type": f_dtype.to_json(zarr_format=zarr_format)} for f_name, f_dtype in self.fields