Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ New Features
variables of a section at once, and shows the expanded attributes and data
more compactly and indented below their variable (:pull:`11284`).
By `Michael Niklas <https://github.com/headtr1ck>`_.
- Use ``check_string_dtype()`` to detect variable-length strings in h5netcdf backend (:pull:`11789`).
By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_.


Breaking Changes
Expand Down
4 changes: 2 additions & 2 deletions xarray/backends/h5netcdf_.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ def open_store_variable(self, name, var):
},
)
else:
vlen_dtype = h5py.check_dtype(vlen=var.dtype)
if vlen_dtype is str:
string_info = h5py.check_string_dtype(var.dtype)
if string_info is not None and string_info.length is None:
encoding["dtype"] = str
else:
# xarray doesn't support writing arbitrary vlen dtypes yet, so
Expand Down
Loading