Skip to content

Commit 8ee46b1

Browse files
committed
revert old fix
1 parent b1c6809 commit 8ee46b1

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

xarray/backends/zarr.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -816,25 +816,9 @@ def open_store_variable(self, name):
816816
if zarr_array.fill_value is not None:
817817
attributes["_FillValue"] = zarr_array.fill_value
818818
elif "_FillValue" in attributes:
819-
# TODO update version check for the released version with dtypes
820-
# probably be 3.1
821-
822-
# if Version(zarr.__version__) > Version("3.0.10"):
823-
if hasattr(zarr_array.metadata.data_type, "to_native_dtype"):
824-
native_dtype = zarr_array.metadata.data_type.to_native_dtype()
825-
attributes["_FillValue"] = (
826-
# Use the new dtype infrastructure instead of doing xarray
827-
# specific fill value decoding
828-
FillValueCoder.decode(
829-
attributes["_FillValue"],
830-
native_dtype,
831-
)
832-
)
833-
else:
834-
dtype_value = zarr_array.metadata.data_type.value
835-
attributes["_FillValue"] = FillValueCoder.decode(
836-
attributes["_FillValue"], dtype_value
837-
)
819+
attributes["_FillValue"] = FillValueCoder.decode(
820+
attributes["_FillValue"], zarr_array.dtype
821+
)
838822

839823
variable = Variable(dimensions, data, attributes, encoding)
840824

0 commit comments

Comments
 (0)