@@ -1849,13 +1849,7 @@ def test_varlen_write_bytes(self):
1849
1849
assert_array_equal (A , T .multi_index [1 : len (A )]["" ])
1850
1850
1851
1851
def test_varlen_sparse_all_empty_strings (self ):
1852
- # this test addresses a fix for specific need for reads on a
1853
- # large existing array, see
1854
- # https://github.com/TileDB-Inc/TileDB-Py/pull/475
1855
- # we currently have to write a placeholder at the end to
1856
- # avoid zero-length cell error
1857
- # TODO: follow-up with improved testing for empty var-length/strings
1858
- A = np .array (["" , "" , "" , "" , "" , "\x00 " ], dtype = object )
1852
+ A = np .array (["" , "" , "" , "" , "" ], dtype = object )
1859
1853
dim_len = len (A )
1860
1854
uri = self .path ("varlen_all_empty_strings" )
1861
1855
@@ -3673,6 +3667,19 @@ def test_from_numpy_append_array3d_overwrite(self, append_dim):
3673
3667
assert A .nonempty_domain () == ((0 , 1 ), (0 , 1 ), (0 , 1 ))
3674
3668
assert_array_equal (A [0 :2 , 0 :2 , 0 :2 ], arr2 )
3675
3669
3670
+ @pytest .mark .parametrize ("empty_str" , ["" , b"" ])
3671
+ @pytest .mark .parametrize ("num_strs" , [1 , 1000 ])
3672
+ def test_from_numpy_empty_str (self , empty_str , num_strs ):
3673
+ uri = self .path ("test_from_numpy_empty_str" )
3674
+ np_array = np .asarray ([empty_str ] * num_strs , dtype = "O" )
3675
+ tiledb .from_numpy (uri , np_array )
3676
+
3677
+ with tiledb .open (uri , "r" ) as A :
3678
+ assert_array_equal (A [:], np_array )
3679
+ if has_pandas ():
3680
+ assert_array_equal (A .query (use_arrow = True ).df [:]["" ], np_array )
3681
+ assert_array_equal (A .query (use_arrow = False ).df [:]["" ], np_array )
3682
+
3676
3683
3677
3684
class ConsolidationTest (DiskTestCase ):
3678
3685
def test_array_vacuum (self ):
0 commit comments