mirror of
https://github.com/lancedb/lancedb.git
synced 2026-09-04 04:28:44 +00:00
test: update create-index default contract coverage
This commit is contained in:
@@ -50,7 +50,7 @@ If this is false, and another index already exists on the same columns
|
||||
and the same name, then an error will be returned. This is true even if
|
||||
that index is out of date.
|
||||
|
||||
The default is true
|
||||
The default is false
|
||||
|
||||
***
|
||||
|
||||
|
||||
@@ -834,7 +834,7 @@ def test_table_create_indices():
|
||||
vector_req = received_requests[2]
|
||||
assert "name" in vector_req
|
||||
assert vector_req["name"] == "custom_vector_idx"
|
||||
assert "replace" not in vector_req
|
||||
assert vector_req["replace"] is False
|
||||
|
||||
table.wait_for_index(["custom_scalar_idx"], timedelta(seconds=2))
|
||||
table.wait_for_index(
|
||||
|
||||
@@ -6306,6 +6306,7 @@ mod tests {
|
||||
let mut expected_body = expected_body.clone();
|
||||
expected_body["column"] = "a".into();
|
||||
expected_body[INDEX_TYPE_KEY] = index_type.into();
|
||||
expected_body["replace"] = false.into();
|
||||
|
||||
assert_eq!(body, expected_body);
|
||||
|
||||
@@ -6615,38 +6616,46 @@ mod tests {
|
||||
json!({
|
||||
"column": "rowId",
|
||||
"index_type": "BTREE",
|
||||
"replace": false,
|
||||
}),
|
||||
json!({
|
||||
"column": "`row-id`",
|
||||
"index_type": "BTREE",
|
||||
"replace": false,
|
||||
}),
|
||||
json!({
|
||||
"column": "userId",
|
||||
"index_type": "BTREE",
|
||||
"replace": false,
|
||||
}),
|
||||
json!({
|
||||
"column": "MetaData.userId",
|
||||
"index_type": "BTREE",
|
||||
"replace": false,
|
||||
}),
|
||||
json!({
|
||||
"column": "metadata.user_id",
|
||||
"index_type": "BTREE",
|
||||
"replace": false,
|
||||
}),
|
||||
json!({
|
||||
"column": "image.embedding",
|
||||
"index_type": "IVF_PQ",
|
||||
"metric_type": "l2",
|
||||
"replace": false,
|
||||
}),
|
||||
{
|
||||
let mut body = serde_json::to_value(InvertedIndexParams::default()).unwrap();
|
||||
body["column"] = "payload.text".into();
|
||||
body["index_type"] = "FTS".into();
|
||||
body["replace"] = false.into();
|
||||
body
|
||||
},
|
||||
{
|
||||
let mut body = serde_json::to_value(InvertedIndexParams::default()).unwrap();
|
||||
body["column"] = "docs.content".into();
|
||||
body["index_type"] = "FTS".into();
|
||||
body["replace"] = false.into();
|
||||
body
|
||||
},
|
||||
{
|
||||
@@ -6654,15 +6663,18 @@ mod tests {
|
||||
body["column"] = "docs.content".into();
|
||||
body["index_type"] = "FTS".into();
|
||||
body["document_granularity"] = "list_element".into();
|
||||
body["replace"] = false.into();
|
||||
body
|
||||
},
|
||||
json!({
|
||||
"column": "`meta-data`.`user-id`",
|
||||
"index_type": "BTREE",
|
||||
"replace": false,
|
||||
}),
|
||||
json!({
|
||||
"column": "literal.`a.b`",
|
||||
"index_type": "BTREE",
|
||||
"replace": false,
|
||||
}),
|
||||
]);
|
||||
let request_idx = Arc::new(AtomicUsize::new(0));
|
||||
|
||||
Reference in New Issue
Block a user