@@ -948,8 +948,16 @@ def test_object_arrays_vlen_text(self):
948
948
data = np .array (greetings * 1000 , dtype = object )
949
949
950
950
z = self .create_array (shape = data .shape , dtype = object , object_codec = VLenUTF8 ())
951
+ z [0 ] = u'foo'
952
+ assert z [0 ] == u'foo'
953
+ z [1 ] = u'bar'
954
+ assert z [1 ] == u'bar'
955
+ z [2 ] = u'baz'
956
+ assert z [2 ] == u'baz'
951
957
z [:] = data
952
- assert_array_equal (data , z [:])
958
+ a = z [:]
959
+ assert a .dtype == object
960
+ assert_array_equal (data , a )
953
961
954
962
# convenience API
955
963
z = self .create_array (shape = data .shape , dtype = text_type )
@@ -981,8 +989,16 @@ def test_object_arrays_vlen_bytes(self):
981
989
data = np .array (greetings_bytes * 1000 , dtype = object )
982
990
983
991
z = self .create_array (shape = data .shape , dtype = object , object_codec = VLenBytes ())
992
+ z [0 ] = b'foo'
993
+ assert z [0 ] == b'foo'
994
+ z [1 ] = b'bar'
995
+ assert z [1 ] == b'bar'
996
+ z [2 ] = b'baz'
997
+ assert z [2 ] == b'baz'
984
998
z [:] = data
985
- assert_array_equal (data , z [:])
999
+ a = z [:]
1000
+ assert a .dtype == object
1001
+ assert_array_equal (data , a )
986
1002
987
1003
# convenience API
988
1004
z = self .create_array (shape = data .shape , dtype = binary_type )
@@ -1013,8 +1029,12 @@ def compare_arrays(expected, actual, item_dtype):
1013
1029
codecs = VLenArray (int ), VLenArray ('<u4' )
1014
1030
for codec in codecs :
1015
1031
z = self .create_array (shape = data .shape , dtype = object , object_codec = codec )
1032
+ z [0 ] = np .array ([4 , 7 ])
1033
+ assert_array_equal (np .array ([4 , 7 ]), z [0 ])
1016
1034
z [:] = data
1017
- compare_arrays (data , z [:], codec .dtype )
1035
+ a = z [:]
1036
+ assert a .dtype == object
1037
+ compare_arrays (data , a , codec .dtype )
1018
1038
1019
1039
# convenience API
1020
1040
for item_type in 'int' , '<u4' :
0 commit comments