apply first round of review comments

This commit is contained in:
Tamo 2024-06-05 12:09:14 +02:00
parent 400cf3eb92
commit 49fa41ce65
3 changed files with 5 additions and 9 deletions

View File

@ -5172,9 +5172,7 @@ mod tests {
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "Intel to kefir"); snapshot!(snapshot_index_scheduler(&index_scheduler), name: "Intel to kefir");
println!("HEEEEERE");
handle.advance_one_successful_batch(); handle.advance_one_successful_batch();
// handle.advance_one_failed_batch();
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "Intel to kefir succeeds"); snapshot!(snapshot_index_scheduler(&index_scheduler), name: "Intel to kefir succeeds");
{ {

View File

@ -1073,12 +1073,10 @@ fn make_hits(
.is_some_and(|conf| conf.user_defined.contains(id)); .is_some_and(|conf| conf.user_defined.contains(id));
let mut embedding = serde_json::Map::new(); let mut embedding = serde_json::Map::new();
embedding.insert("userDefined".to_string(), user_defined.into()); embedding.insert("userDefined".to_string(), user_defined.into());
if vector.len() == 1 { match vector.as_mut_slice() {
let vector = vector.pop().unwrap(); [one] => embedding.insert("embedding".to_string(), std::mem::take(one).into()),
embedding.insert("embedding".to_string(), vector.into()); _ => embedding.insert("embedding".to_string(), vector.into()),
} else { };
embedding.insert("embedding".to_string(), vector.into());
}
vectors.insert(name, embedding.into()); vectors.insert(name, embedding.into());
} }
document.insert("_vectors".into(), vectors.into()); document.insert("_vectors".into(), vectors.into());

View File

@ -1993,7 +1993,7 @@ async fn generate_and_import_dump_containing_vectors() {
let response = index.wait_task(response.uid()).await; let response = index.wait_task(response.uid()).await;
snapshot!(response["status"], @r###""succeeded""###); snapshot!(response["status"], @r###""succeeded""###);
// ========= We made a dump, now we should clear the DB except and try to import our dump // ========= We made a dump, now we should clear the DB and try to import our dump
drop(server); drop(server);
tokio::fs::remove_dir_all(&opt.db_path).await.unwrap(); tokio::fs::remove_dir_all(&opt.db_path).await.unwrap();
let dump_name = format!("{}.dump", response["details"]["dumpUid"].as_str().unwrap()); let dump_name = format!("{}.dump", response["details"]["dumpUid"].as_str().unwrap());