Home / Function/ test_incremental_fails_with_bad_source_ids() — langchain Function Reference

test_incremental_fails_with_bad_source_ids() — langchain Function Reference

Architecture documentation for the test_incremental_fails_with_bad_source_ids() function in test_indexing.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8780297d_d3ea_3b58_74a3_0520689e8450["test_incremental_fails_with_bad_source_ids()"]
  9bc4e8b6_769a_ae11_3fc1_309cb678c248["test_indexing.py"]
  8780297d_d3ea_3b58_74a3_0520689e8450 -->|defined in| 9bc4e8b6_769a_ae11_3fc1_309cb678c248
  style 8780297d_d3ea_3b58_74a3_0520689e8450 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/indexes/test_indexing.py lines 417–458

def test_incremental_fails_with_bad_source_ids(
    record_manager: SQLRecordManager,
    vector_store: InMemoryVectorStore,
) -> None:
    """Test indexing with incremental deletion strategy."""
    loader = ToyLoader(
        documents=[
            Document(
                page_content="This is a test document.",
                metadata={"source": "1"},
            ),
            Document(
                page_content="This is another document.",
                metadata={"source": "2"},
            ),
            Document(
                page_content="This is yet another document.",
                metadata={"source": None},
            ),
        ],
    )

    with pytest.raises(
        ValueError,
        match="Source id key is required when cleanup mode is incremental "
        "or scoped_full",
    ):
        # Should raise an error because no source id function was specified
        index(loader, record_manager, vector_store, cleanup="incremental")

    with pytest.raises(
        ValueError,
        match="Source IDs are required when cleanup mode is incremental or scoped_full",
    ):
        # Should raise an error because no source id function was specified
        index(
            loader,
            record_manager,
            vector_store,
            cleanup="incremental",
            source_id_key="source",
        )

Domain

Subdomains

Frequently Asked Questions

What does test_incremental_fails_with_bad_source_ids() do?
test_incremental_fails_with_bad_source_ids() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/indexes/test_indexing.py.
Where is test_incremental_fails_with_bad_source_ids() defined?
test_incremental_fails_with_bad_source_ids() is defined in libs/langchain/tests/unit_tests/indexes/test_indexing.py at line 417.

Analyze Your Own Codebase

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

Try Supermodel Free