diff --git a/src/zarr/core/dtype/npy/structured.py b/src/zarr/core/dtype/npy/structured.py index d9e1ff55ae..07e3000826 100644 --- a/src/zarr/core/dtype/npy/structured.py +++ b/src/zarr/core/dtype/npy/structured.py @@ -162,8 +162,10 @@ def to_json( [f_name, f_dtype.to_json(zarr_format=zarr_format)] # type: ignore[list-item] for f_name, f_dtype in self.fields ] - base_dict = {"name": self._zarr_v3_name} - base_dict["configuration"] = {"fields": fields} # type: ignore[assignment] + base_dict = { + "name": self._zarr_v3_name, + "configuration": {"fields": fields}, + } return cast("DTypeSpec_V3", base_dict) raise ValueError(f"zarr_format must be 2 or 3, got {zarr_format}") # pragma: no cover