File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,25 @@ def test_nan_complex_imag(self):
219
219
table .get_item (other )
220
220
assert str (error .value ) == str (other )
221
221
222
+ def test_nan_in_tuple (self ):
223
+ nan1 = (float ("nan" ),)
224
+ nan2 = (float ("nan" ),)
225
+ assert nan1 [0 ] is not nan2 [0 ]
226
+ table = ht .PyObjectHashTable ()
227
+ table .set_item (nan1 , 42 )
228
+ assert table .get_item (nan2 ) == 42
229
+
230
+ def test_nan_in_nested_tuple (self ):
231
+ nan1 = (1 , (2 , (float ("nan" ),)))
232
+ nan2 = (1 , (2 , (float ("nan" ),)))
233
+ other = (1 , 2 )
234
+ table = ht .PyObjectHashTable ()
235
+ table .set_item (nan1 , 42 )
236
+ assert table .get_item (nan2 ) == 42
237
+ with pytest .raises (KeyError , match = None ) as error :
238
+ table .get_item (other )
239
+ assert str (error .value ) == str (other )
240
+
222
241
223
242
def test_get_labels_groupby_for_Int64 (writable ):
224
243
table = ht .Int64HashTable ()
You can’t perform that action at this time.
0 commit comments