Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore: cleanup test_delete_by_document_id method in opensearch vdb test (#5619)

Bowen Liang31a061ebaa30
diff --git a/api/tests/integration_tests/vdb/opensearch/test_opensearch.py b/api/tests/integration_tests/vdb/opensearch/test_opensearch.py
index 4a67c39a98f..ea1e05da900 100644
--- a/api/tests/integration_tests/vdb/opensearch/test_opensearch.py
+++ b/api/tests/integration_tests/vdb/opensearch/test_opensearch.py
@@ -91,18 +91,6 @@ class TestOpenSearchVector:
assert hits_by_vector[0].metadata['document_id'] == self.example_doc_id, \
f"Expected document ID {self.example_doc_id}, got {hits_by_vector[0].metadata['document_id']}"
- doc = Document(page_content="Test content to delete", metadata={"document_id": self.example_doc_id})
- embedding = [0.1] * 128
-
- with patch('opensearchpy.helpers.bulk') as mock_bulk:
- mock_bulk.return_value = ([], [])
- self.vector.add_texts([doc], [embedding])
-
- self.vector._client.search.return_value = {'hits': {'total': {'value': 0}, 'hits': []}}
-
- ids = self.vector.get_ids_by_metadata_field(key='document_id', value=self.example_doc_id)
- assert ids is None or len(ids) == 0
-
def test_get_ids_by_metadata_field(self):
mock_response = {
'hits': {