Home / Function/ test_deleting_documents_async() — langchain Function Reference

test_deleting_documents_async() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/vectorstores.py lines 556–576

    async def test_deleting_documents_async(self, vectorstore: VectorStore) -> None:
        """Test deleting documents from the `VectorStore`.

        ??? note "Troubleshooting"

            If this test fails, check that `aadd_documents` preserves identifiers
            passed in through `ids`, and that `delete` correctly removes
            documents.
        """
        if not self.has_async:
            pytest.skip("Async tests not supported.")

        documents = [
            Document(page_content="foo", metadata={"id": 1}),
            Document(page_content="bar", metadata={"id": 2}),
        ]
        ids = await vectorstore.aadd_documents(documents, ids=["1", "2"])
        assert ids == ["1", "2"]
        await vectorstore.adelete(["1"])
        documents = await vectorstore.asimilarity_search("foo", k=1)
        assert documents == [Document(page_content="bar", metadata={"id": 2}, id="2")]

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free