Skip to content

Commit

Permalink
chore: adding a deprecation warning on the SentenceWindowRetriever (#…
Browse files Browse the repository at this point in the history
…8597)

* linting

* improving message

* fixing header

* adding deprecation in the release notes
  • Loading branch information
davidsbatista authored and Amnah199 committed Dec 4, 2024
1 parent 314d16b commit e642844
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions haystack/components/retrievers/sentence_window_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

import warnings
from typing import Any, Dict, List, Optional

from haystack import Document, component, default_from_dict, default_to_dict
Expand Down Expand Up @@ -92,6 +93,13 @@ def __init__(self, document_store: DocumentStore, window_size: int = 3):
self.window_size = window_size
self.document_store = document_store

warnings.warn(
"The output of `context_documents` will change in the next release. Instead of a "
"List[List[Document]], the output will be a List[Document], where the documents are ordered by "
"`split_idx_start`.",
DeprecationWarning,
)

@staticmethod
def merge_documents_text(documents: List[Document]) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
deprecations:
|
"The output of `context_documents` will change in the next release. Instead of a List[List[Document]], the output will be a List[Document], where the documents are ordered by `split_idx_start`.",

0 comments on commit e642844

Please sign in to comment.