Skip to content

Commit 678f9fd

Browse files
committed
chore: New API check_state_compatibility
Signed-off-by: Anush008 <[email protected]>
1 parent 61aa6d0 commit 678f9fd

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Diff for: examples/pdf_embedding/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def pdf_embedding_flow(flow_builder: cocoindex.FlowBuilder, data_scope: cocoinde
6161

6262
doc_embeddings.export(
6363
"doc_embeddings",
64-
cocoindex.storages.Qdrant(qdrant_url="http://localhost:6333", collection_name="cocoindex"),
64+
cocoindex.storages.Qdrant(collection_name="cocoindex"),
6565
primary_key_fields=["id"],
6666
vector_index=[("embedding", cocoindex.VectorSimilarityMetric.COSINE_SIMILARITY)])
6767

Diff for: src/ops/storages/qdrant.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ impl StorageFactoryBase for Arc<Factory> {
375375
fn build(
376376
self: Arc<Self>,
377377
_name: String,
378-
_target_id: i32,
379378
spec: Spec,
380379
key_fields_schema: Vec<FieldSchema>,
381380
value_fields_schema: Vec<FieldSchema>,
@@ -385,6 +384,7 @@ impl StorageFactoryBase for Arc<Factory> {
385384
(CollectionId, SetupState),
386385
ExecutorFuture<'static, (Arc<dyn ExportTargetExecutor>, Option<Arc<dyn QueryTarget>>)>,
387386
)> {
387+
// TODO(Anush008): Add as a field to the Spec
388388
let url = "http://localhost:6334/";
389389
let collection_name = spec.collection_name;
390390
let table_id = CollectionId {
@@ -418,13 +418,11 @@ impl StorageFactoryBase for Arc<Factory> {
418418
Ok(SetupStatusCheck::new(key, desired))
419419
}
420420

421-
fn will_keep_all_existing_data(
421+
fn check_state_compatibility(
422422
&self,
423-
_name: &str,
424-
_target_id: i32,
425423
_desired: &SetupState,
426424
_existing: &SetupState,
427-
) -> Result<bool> {
428-
Ok(true)
425+
) -> Result<SetupStateCompatibility> {
426+
Ok(SetupStateCompatibility::Compatible)
429427
}
430428
}

0 commit comments

Comments
 (0)