Skip to content

Commit 162da68

Browse files
committed
fix(weaviate): restore unrelated comments and docstrings
1 parent 8f8aaf8 commit 162da68

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • integrations/weaviate/src/haystack_integrations/document_stores/weaviate

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,16 @@ def _batch_write(self, documents: list[Document], tenant: str | None = None) ->
970970
if failed_objects := self.client.batch.failed_objects:
971971
self._handle_failed_objects(failed_objects)
972972

973+
# If the document already exists we get no status message back from Weaviate.
974+
# So we assume that all Documents were written.
973975
return len(documents)
974976

975977
async def _batch_write_async(self, documents: list[Document], tenant: str | None = None) -> int:
976978
"""
977979
Asynchronously writes document to Weaviate in batches.
980+
981+
Documents with the same id will be overwritten.
982+
Raises in case of errors.
978983
"""
979984

980985
client = await self.async_client
@@ -1358,7 +1363,9 @@ def update_by_filter(self, filters: dict[str, Any], meta: dict[str, Any]) -> int
13581363
matching_objects = self._query_with_filters(filters)
13591364
if not matching_objects:
13601365
return 0
1361-
1366+
1367+
# Update each object with the new metadata
1368+
# Since metadata is stored flattened in Weaviate properties, we update properties directly
13621369
updated_count = 0
13631370
failed_updates = []
13641371

0 commit comments

Comments
 (0)