@@ -80,6 +80,8 @@ def test_map(self, table_type, dtype):
80
80
table = table_type ()
81
81
keys = np .arange (N ).astype (dtype )
82
82
vals = np .arange (N ).astype (np .int64 ) + N
83
+ keys .flags .writeable = False
84
+ vals .flags .writeable = False
83
85
table .map (keys , vals )
84
86
for i in range (N ):
85
87
assert table .get_item (keys [i ]) == i + N
@@ -88,6 +90,7 @@ def test_map_locations(self, table_type, dtype):
88
90
N = 8
89
91
table = table_type ()
90
92
keys = (np .arange (N ) + N ).astype (dtype )
93
+ keys .flags .writeable = False
91
94
table .map_locations (keys )
92
95
for i in range (N ):
93
96
assert table .get_item (keys [i ]) == i
@@ -96,6 +99,7 @@ def test_lookup(self, table_type, dtype):
96
99
N = 3
97
100
table = table_type ()
98
101
keys = (np .arange (N ) + N ).astype (dtype )
102
+ keys .flags .writeable = False
99
103
table .map_locations (keys )
100
104
result = table .lookup (keys )
101
105
expected = np .arange (N )
@@ -121,6 +125,7 @@ def test_unique(self, table_type, dtype):
121
125
table = table_type ()
122
126
expected = (np .arange (N ) + N ).astype (dtype )
123
127
keys = np .repeat (expected , 5 )
128
+ keys .flags .writeable = False
124
129
unique = table .unique (keys )
125
130
tm .assert_numpy_array_equal (unique , expected )
126
131
@@ -254,6 +259,7 @@ def test_duplicated_first(self, dtype, type_suffix):
254
259
N = 100
255
260
duplicated = get_ht_function ("duplicated" , type_suffix )
256
261
values = np .repeat (np .arange (N ).astype (dtype ), 5 )
262
+ values .flags .writeable = False
257
263
result = duplicated (values )
258
264
expected = np .ones_like (values , dtype = np .bool_ )
259
265
expected [::5 ] = False
@@ -264,6 +270,8 @@ def test_ismember_yes(self, dtype, type_suffix):
264
270
ismember = get_ht_function ("ismember" , type_suffix )
265
271
arr = np .arange (N ).astype (dtype )
266
272
values = np .arange (N ).astype (dtype )
273
+ arr .flags .writeable = False
274
+ values .flags .writeable = False
267
275
result = ismember (arr , values )
268
276
expected = np .ones_like (values , dtype = np .bool_ )
269
277
tm .assert_numpy_array_equal (result , expected )
0 commit comments