Skip to content

Commit

Permalink
Explicitly specify comparison to previous commit in pre-commit action
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Jan 12, 2024
1 parent 7174615 commit ee73396
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/base_tests_zarrio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '<i4'), ('name', '<U25'), ('reference', 'O')])
ref_dtype = np.dtype([('id', '<i4'), ('name', 'O'), ('reference', 'O')])
self.assertEqual(read_builder.data.dataset.dtype, ref_dtype)

# Load the elements of each entry in the compound dataset and compar the index, string, and referenced array
Expand Down

0 comments on commit ee73396

Please sign in to comment.