Skip to content

Commit 4542792

Browse files
committed
Set appropriate fill value for lazy arrays
1 parent 5251e59 commit 4542792

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mdio/schemas/v1/dataset_serializer.py

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

198198
# Use dask.array.zeros to create a lazy array
199-
data = dask_array.zeros(shape=shape, dtype=dtype, chunks=chunks)
199+
data = dask_array.full(shape=shape, dtype=dtype, chunks=chunks, fill_value=_get_fill_value(v.data_type))
200200
# Create a DataArray for the variable. We will set coords in the second pass
201201
dim_names = _get_dimension_names(v)
202202
data_array = xr_DataArray(data, dims=dim_names)

0 commit comments

Comments
 (0)