From 59d95dc64defda941e2a605e9865af36ff68b22a Mon Sep 17 00:00:00 2001 From: Agisilaos Kounelis Date: Tue, 4 Feb 2025 13:04:23 +0200 Subject: [PATCH] Add test --- tiledb/tests/test_fixes.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tiledb/tests/test_fixes.py b/tiledb/tests/test_fixes.py index 0bb8cb8472..9d7a6b9cf0 100644 --- a/tiledb/tests/test_fixes.py +++ b/tiledb/tests/test_fixes.py @@ -354,6 +354,31 @@ def test_sc56611(self): tiledb.from_numpy(uri, data, sparse=True) assert str(exc_info.value) == "from_numpy only supports dense arrays" + @pytest.mark.parametrize( + "array_data", + [ + np.array([b"", b"1", b"", b"", b"f", b""], dtype="S"), + np.array([b"", b"1", b"", b"", b"f", b"3"], dtype="S"), + ], + ) + def test_sc62594_buffer_resize(self, array_data): + uri = self.path("test_agis") + dom = tiledb.Domain( + tiledb.Dim(name="dim", domain=(0, 5), tile=2, dtype=np.int64), + ) + + schema = tiledb.ArraySchema( + domain=dom, sparse=False, attrs=[tiledb.Attr(name="a", dtype="S", var=True)] + ) + + tiledb.DenseArray.create(uri, schema) + + with tiledb.DenseArray(uri, mode="w") as T: + T[...] = array_data + + with tiledb.DenseArray(uri) as T: + assert_array_equal(array_data, T) + class SOMA919Test(DiskTestCase): """