From 17f7d0644d8f6ffaeac332ef02f32956d1313b47 Mon Sep 17 00:00:00 2001 From: Marco Juliani Date: Wed, 24 Apr 2024 09:19:52 -0400 Subject: [PATCH] Update document_writer.py --- haystack/components/writers/document_writer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/haystack/components/writers/document_writer.py b/haystack/components/writers/document_writer.py index a0ed98c3e0..76384d8f59 100644 --- a/haystack/components/writers/document_writer.py +++ b/haystack/components/writers/document_writer.py @@ -109,5 +109,8 @@ def run(self, documents: List[Document], policy: Optional[DuplicatePolicy] = Non if policy is None: policy = self.policy + for document in documents: + document.content = document.content.replace('\x00', '') + documents_written = self.document_store.write_documents(documents=documents, policy=policy) return {"documents_written": documents_written}