File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
welearn_datastack/modules Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -134,3 +134,28 @@ def test_should_handle_multiple_slices_for_same_collection_with_multi_lingual_co
134
134
"collection_welearn_mul_mulembmodel" : {doc_id1 },
135
135
}
136
136
self .assertDictEqual (dict (collections_names ), expected )
137
+
138
+ def test_should_handle_multiple_slices_for_same_collection_with_multi_lingual_collection_and_gibberish (
139
+ self ,
140
+ ):
141
+ self .client .create_collection (
142
+ collection_name = "collection_welearn_mul_mulembmodel_og" ,
143
+ vectors_config = models .VectorParams (
144
+ size = 50 , distance = models .Distance .COSINE
145
+ ),
146
+ )
147
+
148
+ doc_id0 = uuid .uuid4 ()
149
+ doc_id1 = uuid .uuid4 ()
150
+ qdrant_connector = self .client
151
+ fake_slice0 = FakeSlice (doc_id0 , embedding_model_name = "english-embmodel" )
152
+ fake_slice1 = FakeSlice (doc_id0 , embedding_model_name = "english-embmodel" )
153
+
154
+ fake_slice1 .order_sequence = 1
155
+
156
+ fake_slice2 = FakeSlice (doc_id1 , embedding_model_name = "mulembmodel" )
157
+ fake_slice2 .document .lang = "pt"
158
+
159
+ slices = [fake_slice0 , fake_slice1 , fake_slice2 ]
160
+ collections_names = classify_documents_per_collection (qdrant_connector , slices )
161
+ self .assertNotIn ("collection_welearn_mul_mulembmodel_og" , collections_names )
Original file line number Diff line number Diff line change 9
9
from qdrant_client .http .models import models
10
10
11
11
from welearn_datastack .data .db_models import DocumentSlice
12
- from welearn_datastack .exceptions import (
13
- ErrorWhileDeletingChunks ,
14
- )
12
+ from welearn_datastack .exceptions import ErrorWhileDeletingChunks
15
13
16
14
logger = logging .getLogger (__name__ )
17
15
@@ -79,7 +77,6 @@ def delete_points_related_to_document(
79
77
"""
80
78
logger .info ("Deletion started" )
81
79
logger .debug (f"Deleting points related to { documents_ids } in { collection_name } " )
82
- op_res = None
83
80
84
81
try :
85
82
op_res = qdrant_connector .delete (
You can’t perform that action at this time.
0 commit comments