Skip to content

Commit 72697eb

Browse files
committed
Eliminate immediate overwrite of data bug
1 parent 16ec241 commit 72697eb

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/mdio/schemas/v1/dataset_serializer.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,7 @@ def to_xarray_dataset(mdio_ds: Dataset) -> xr_Dataset: # noqa: PLR0912
196196
dtype = to_numpy_dtype(v.data_type)
197197
chunks = _get_zarr_chunks(v, all_named_dims=all_named_dims)
198198

199-
if hasattr(dtype, "fields"):
200-
data = zarr_zeros(shape=shape, dtype=dtype, zarr_format=2)
201-
else:
202-
data = dask_array.zeros(shape=shape, dtype=dtype, chunks=chunks)
203-
204-
# Use dask.array.zeros to create a lazy array with the specified shape and dtype
205-
# This prevents eager memory allocation while maintaining support for structured dtypes
199+
# Use dask.array.zeros to create a lazy array
206200
data = dask_array.zeros(shape=shape, dtype=dtype, chunks=chunks)
207201
# Create a DataArray for the variable. We will set coords in the second pass
208202
dim_names = _get_dimension_names(v)

0 commit comments

Comments
 (0)