diff --git a/src/hdmf_zarr/backend.py b/src/hdmf_zarr/backend.py index fa8cab43..fbdf91f3 100644 --- a/src/hdmf_zarr/backend.py +++ b/src/hdmf_zarr/backend.py @@ -1033,7 +1033,8 @@ def write_dataset(self, **kwargs): # noqa: C901 if field['dtype'] is str or field['dtype'] in ( 'str', 'text', 'utf', 'utf8', 'utf-8', 'isodatetime' ): - new_dtype.append((field['name'], 'U25')) + # Zarr does not support variable length strings + new_dtype.append((field['name'], 'O')) elif isinstance(field['dtype'], dict): # eg. for some references, dtype will be of the form # {'target_type': 'Baz', 'reftype': 'object'} diff --git a/tests/unit/base_tests_zarrio.py b/tests/unit/base_tests_zarrio.py index 81ab9416..ec1758cd 100644 --- a/tests/unit/base_tests_zarrio.py +++ b/tests/unit/base_tests_zarrio.py @@ -436,7 +436,7 @@ def test_read_reference_compound(self): read_builder = self.root['ref_dataset'] # ensure the array was written as a compound array - ref_dtype = np.dtype([('id', '