Skip to content

Commit

Permalink
Fix the partition example (#1219)
Browse files Browse the repository at this point in the history
Signed-off-by: SimFG <[email protected]>

Signed-off-by: SimFG <[email protected]>
  • Loading branch information
SimFG authored Nov 9, 2022
1 parent fe1695c commit 2e1d23a
Show file tree
Hide file tree
Showing 3 changed files with 287 additions and 277 deletions.
12 changes: 11 additions & 1 deletion examples/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,20 @@ def test_partition():

data = gen_data(default_nb)
print("insert data to partition")
partition.insert(data)
res = partition.insert(data)
collection.flush()
print(res.insert_count)
assert partition.is_empty is False
assert partition.num_entities == default_nb

print("start to create index")
index = {
"index_type": "IVF_FLAT",
"metric_type": "L2",
"params": {"nlist": 128},
}
collection.create_index(default_float_vec_field_name, index)

print("load partition")
partition.load()
topK = 5
Expand Down
Loading

0 comments on commit 2e1d23a

Please sign in to comment.