Skip to content

Commit 6985a8f

Browse files
committed
More type hints
1 parent e52b768 commit 6985a8f

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(
4646
score_threshold: Optional[float] = None,
4747
group_by: Optional[str] = None,
4848
group_size: Optional[int] = None,
49-
):
49+
) -> None:
5050
"""
5151
Create a QdrantEmbeddingRetriever component.
5252
@@ -136,7 +136,7 @@ def run(
136136
score_threshold: Optional[float] = None,
137137
group_by: Optional[str] = None,
138138
group_size: Optional[int] = None,
139-
):
139+
) -> Dict[str, List[Document]]:
140140
"""
141141
Run the Embedding Retriever on the given input data.
142142
@@ -180,7 +180,7 @@ async def run_async(
180180
score_threshold: Optional[float] = None,
181181
group_by: Optional[str] = None,
182182
group_size: Optional[int] = None,
183-
):
183+
) -> Dict[str, List[Document]]:
184184
"""
185185
Asynchronously run the Embedding Retriever on the given input data.
186186
@@ -252,7 +252,7 @@ def __init__(
252252
score_threshold: Optional[float] = None,
253253
group_by: Optional[str] = None,
254254
group_size: Optional[int] = None,
255-
):
255+
) -> None:
256256
"""
257257
Create a QdrantSparseEmbeddingRetriever component.
258258
@@ -342,7 +342,7 @@ def run(
342342
score_threshold: Optional[float] = None,
343343
group_by: Optional[str] = None,
344344
group_size: Optional[int] = None,
345-
):
345+
) -> Dict[str, List[Document]]:
346346
"""
347347
Run the Sparse Embedding Retriever on the given input data.
348348
@@ -391,7 +391,7 @@ async def run_async(
391391
score_threshold: Optional[float] = None,
392392
group_by: Optional[str] = None,
393393
group_size: Optional[int] = None,
394-
):
394+
) -> Dict[str, List[Document]]:
395395
"""
396396
Asynchronously run the Sparse Embedding Retriever on the given input data.
397397
@@ -473,7 +473,7 @@ def __init__(
473473
score_threshold: Optional[float] = None,
474474
group_by: Optional[str] = None,
475475
group_size: Optional[int] = None,
476-
):
476+
) -> None:
477477
"""
478478
Create a QdrantHybridRetriever component.
479479
@@ -557,7 +557,7 @@ def run(
557557
score_threshold: Optional[float] = None,
558558
group_by: Optional[str] = None,
559559
group_size: Optional[int] = None,
560-
):
560+
) -> Dict[str, List[Document]]:
561561
"""
562562
Run the Sparse Embedding Retriever on the given input data.
563563
@@ -606,7 +606,7 @@ async def run_async(
606606
score_threshold: Optional[float] = None,
607607
group_by: Optional[str] = None,
608608
group_size: Optional[int] = None,
609-
):
609+
) -> Dict[str, List[Document]]:
610610
"""
611611
Asynchronously run the Sparse Embedding Retriever on the given input data.
612612

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def convert_filters_to_qdrant(
138138

139139

140140
def build_filters_for_repeated_operators(
141-
must_clauses,
142-
should_clauses,
143-
must_not_clauses,
144-
qdrant_filter,
141+
must_clauses: List,
142+
should_clauses: List,
143+
must_not_clauses: List,
144+
qdrant_filter: List[models.Filter],
145145
) -> List[models.Filter]:
146146
"""
147147
Flattens the nested lists of clauses by creating separate Filters for each clause of a logical operator.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
logger.setLevel(python_logging.INFO)
1212

1313

14-
def migrate_to_sparse_embeddings_support(old_document_store: QdrantDocumentStore, new_index: str):
14+
def migrate_to_sparse_embeddings_support(old_document_store: QdrantDocumentStore, new_index: str) -> None:
1515
"""
1616
Utility function to migrate an existing `QdrantDocumentStore` to a new one with support for sparse embeddings.
1717

0 commit comments

Comments
 (0)