Skip to content

Commit 14ac8d9

Browse files
committed
raise error when we can be sure there is no object codec
1 parent 2835eb2 commit 14ac8d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

zarr/tests/test_core.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,14 @@ def test_dtypes(self):
876876
def test_object_arrays(self):
877877

878878
# an object_codec is required for object arrays
879-
with pytest.warns(FutureWarning):
879+
with pytest.raises(ValueError):
880880
self.create_array(shape=10, chunks=3, dtype=object)
881881

882+
# an object_codec is required for object arrays, but allow to be provided via
883+
# filters to maintain API backwards compatibility
884+
with pytest.warns(FutureWarning):
885+
self.create_array(shape=10, chunks=3, dtype=object, filters=[MsgPack()])
886+
882887
# create an object array using msgpack
883888
z = self.create_array(shape=10, chunks=3, dtype=object, object_codec=MsgPack())
884889
z[0] = 'foo'

0 commit comments

Comments
 (0)