Home / Function/ test_deleting_bulk_documents() — langchain Function Reference

test_deleting_bulk_documents() — langchain Function Reference

Architecture documentation for the test_deleting_bulk_documents() function in vectorstores.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  90b4efa0_d801_145e_5873_029594497394["test_deleting_bulk_documents()"]
  6b7f515d_5b14_acff_3191_2493436e519d["VectorStoreIntegrationTests"]
  90b4efa0_d801_145e_5873_029594497394 -->|defined in| 6b7f515d_5b14_acff_3191_2493436e519d
  style 90b4efa0_d801_145e_5873_029594497394 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/vectorstores.py lines 227–247

    def test_deleting_bulk_documents(self, vectorstore: VectorStore) -> None:
        """Test that we can delete several documents at once.

        ??? note "Troubleshooting"

            If this test fails, check that `delete` correctly removes multiple
            documents when given a list of IDs.
        """
        if not self.has_sync:
            pytest.skip("Sync tests not supported.")

        documents = [
            Document(page_content="foo", metadata={"id": 1}),
            Document(page_content="bar", metadata={"id": 2}),
            Document(page_content="baz", metadata={"id": 3}),
        ]

        vectorstore.add_documents(documents, ids=["1", "2", "3"])
        vectorstore.delete(["1", "2"])
        documents = vectorstore.similarity_search("foo", k=1)
        assert documents == [Document(page_content="baz", metadata={"id": 3}, id="3")]

Subdomains

Frequently Asked Questions

What does test_deleting_bulk_documents() do?
test_deleting_bulk_documents() is a function in the langchain codebase, defined in libs/standard-tests/langchain_tests/integration_tests/vectorstores.py.
Where is test_deleting_bulk_documents() defined?
test_deleting_bulk_documents() is defined in libs/standard-tests/langchain_tests/integration_tests/vectorstores.py at line 227.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free