|
9 | 9 | from tiledb.cloud.dag import Mode |
10 | 10 |
|
11 | 11 | MINIMUM_ACCURACY = 0.85 |
| 12 | +MAX_UINT64 = np.iinfo(np.dtype("uint64")).max |
12 | 13 |
|
13 | 14 |
|
14 | 15 | def test_flat_ingestion_u8(tmp_path): |
@@ -307,11 +308,12 @@ def test_ivf_flat_ingestion_with_updates(tmp_path): |
307 | 308 | _, result = index.query(query_vectors, k=k, nprobe=nprobe) |
308 | 309 | assert accuracy(result, gt_i) > MINIMUM_ACCURACY |
309 | 310 |
|
| 311 | + update_ids_offset = MAX_UINT64-size |
310 | 312 | updated_ids = {} |
311 | 313 | for i in range(100): |
312 | 314 | index.delete(external_id=i) |
313 | | - index.update(vector=data[i].astype(dtype), external_id=i + 1000000) |
314 | | - updated_ids[i + 1000000] = i |
| 315 | + index.update(vector=data[i].astype(dtype), external_id=i + update_ids_offset) |
| 316 | + updated_ids[i + update_ids_offset] = i |
315 | 317 |
|
316 | 318 | _, result = index.query(query_vectors, k=k, nprobe=nprobe) |
317 | 319 | assert accuracy(result, gt_i, updated_ids=updated_ids) > MINIMUM_ACCURACY |
@@ -346,9 +348,10 @@ def test_ivf_flat_ingestion_with_batch_updates(tmp_path): |
346 | 348 |
|
347 | 349 | update_ids = {} |
348 | 350 | updated_ids = {} |
| 351 | + update_ids_offset = MAX_UINT64 - size |
349 | 352 | for i in range(0, 100000, 2): |
350 | | - update_ids[i] = i + 1000000 |
351 | | - updated_ids[i + 1000000] = i |
| 353 | + update_ids[i] = i + update_ids_offset |
| 354 | + updated_ids[i + update_ids_offset] = i |
352 | 355 | external_ids = np.zeros((len(update_ids) * 2), dtype=np.uint64) |
353 | 356 | updates = np.empty((len(update_ids) * 2), dtype='O') |
354 | 357 | id = 0 |
|
0 commit comments