Skip to content

Commit 49bec85

Browse files
committed
linting issues and formatting
1 parent 4256983 commit 49bec85

2 files changed

Lines changed: 5 additions & 24 deletions

File tree

integrations/qdrant/src/haystack_integrations/document_stores/qdrant/document_store.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ async def delete_documents_async(self, document_ids: List[str]) -> None:
523523
"Called QdrantDocumentStore.delete_documents_async() on a non-existing ID",
524524
)
525525

526-
def delete_all_documents(self, recreate_index: bool = False):
526+
def delete_all_documents(self, recreate_index: bool = False) -> None:
527527
"""
528528
Deletes all documents from the document store.
529529
@@ -534,40 +534,23 @@ def delete_all_documents(self, recreate_index: bool = False):
534534
assert self._client is not None
535535

536536
if recreate_index:
537-
538537
# get current collection config
539538
collection_info = self._client.get_collection(collection_name=self.index)
540539

541-
"""
542-
x = CollectionInfo(
543-
status= < CollectionStatus.GREEN: 'green' >,
544-
optimizer_status = < OptimizersStatusOneOf.OK: 'ok' >, vectors_count = None, indexed_vectors_count = 0, points_count = 5, segments_count = 1, config = CollectionConfig(
545-
params=CollectionParams(vectors=VectorParams(size=768, distance= < Distance.COSINE: 'Cosine' >, hnsw_config = None, quantization_config = None, on_disk = False, datatype = None, multivector_config = None), shard_number = None, sharding_method = None, replication_factor = None, write_consistency_factor = None, read_fan_out_factor = None, on_disk_payload = None, sparse_vectors = None), hnsw_config = HnswConfig(
546-
m=16, ef_construct=100, full_scan_threshold=10000, max_indexing_threads=0, on_disk=None,
547-
payload_m=None), optimizer_config = OptimizersConfig(deleted_threshold=0.2,
548-
vacuum_min_vector_number=1000,
549-
default_segment_number=0, max_segment_size=None,
550-
memmap_threshold=None, indexing_threshold=20000,
551-
flush_interval_sec=5,
552-
max_optimization_threads=1), wal_config = WalConfig(
553-
wal_capacity_mb=32,
554-
wal_segments_ahead=0), quantization_config = None, strict_mode_config = None), payload_schema = {})
555-
"""
556-
557540
# recreate collection
558541
self._set_up_collection(
559542
collection_name=self.index,
560543
embedding_dim=collection_info.config.params.vectors.size,
561544
recreate_collection=True,
562545
similarity=collection_info.config.params.vectors.distance.value,
563546
use_sparse_embeddings=collection_info.config.params.sparse_vectors == SPARSE_VECTORS_NAME,
564-
sparse_idf=(collection_info.config.params.vectors.name == SPARSE_VECTORS_NAME) and
565-
collection_info.config.params.vectors.config.hnsw_config is not None,
547+
sparse_idf=(collection_info.config.params.vectors.name == SPARSE_VECTORS_NAME)
548+
and collection_info.config.params.vectors.config.hnsw_config is not None,
566549
on_disk=collection_info.config.params.vectors.config.on_disk,
567550
# ToDo: investigate
568551
# - CollectionInfo has payload_schema as Optional[Dict[str, PayloadSchemaType]],
569552
# - self._set_up_collection expects Optional[List[dict]]
570-
payload_fields_to_index=None
553+
payload_fields_to_index=None,
571554
)
572555

573556
try:
@@ -585,8 +568,6 @@ def delete_all_documents(self, recreate_index: bool = False):
585568
f"Error {e} when calling QdrantDocumentStore.delete_all_documents()",
586569
)
587570

588-
589-
590571
@classmethod
591572
def from_dict(cls, data: Dict[str, Any]) -> "QdrantDocumentStore":
592573
"""

integrations/qdrant/tests/test_document_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,4 @@ def test_delete_all_documents_index_recreation(self, document_store):
334334

335335
# ensure the collection still exists by writing documents again
336336
document_store.write_documents(docs)
337-
assert document_store.count_documents() == 5
337+
assert document_store.count_documents() == 5

0 commit comments

Comments
 (0)