mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-27 23:18:37 +00:00
feat: Tweak CacheChecker output type (#6719)
* specify cache checker output type * (de)serialization * tests * add default value for type * reno * mypy * feedback * reduce diff * reduce diff * reno
This commit is contained in:
parent
79d67b0338
commit
60780ce897
@ -57,7 +57,7 @@ class CacheChecker:
|
||||
data["init_parameters"]["document_store"] = docstore
|
||||
return default_from_dict(cls, data)
|
||||
|
||||
@component.output_types(hits=List[Document], misses=List[Any])
|
||||
@component.output_types(hits=List[Document], misses=List)
|
||||
def run(self, items: List[Any]):
|
||||
"""
|
||||
Checks if any document associated with the specified field is already present in the store. If matching documents
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
---
|
||||
enhancements:
|
||||
- Modify the output type of `CacheChecker` from `List[Any]` to `List` to make it possible to connect it in a Pipeline.
|
||||
@ -6,7 +6,7 @@ from haystack.document_stores.in_memory import InMemoryDocumentStore
|
||||
from haystack.components.caching.cache_checker import CacheChecker
|
||||
|
||||
|
||||
class TestUrlCacheChecker:
|
||||
class TestCacheChecker:
|
||||
def test_to_dict(self):
|
||||
mocked_docstore_class = document_store_class("MockedDocumentStore")
|
||||
component = CacheChecker(document_store=mocked_docstore_class(), cache_field="url")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user