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
  fdfd1960_c0fa_275b_08ec_5a296c9863e4["test_incremental_fails_with_bad_source_ids()"]
  576ad89d_c8dc_eddf_9cd2_c8ae0e7c9978["test_indexing.py"]
  fdfd1960_c0fa_275b_08ec_5a296c9863e4 -->|defined in| 576ad89d_c8dc_eddf_9cd2_c8ae0e7c9978
  style fdfd1960_c0fa_275b_08ec_5a296c9863e4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/indexing/test_indexing.py lines 570–617

def test_incremental_fails_with_bad_source_ids(
    record_manager: InMemoryRecordManager, 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",
            key_encoder="sha256",
        )

    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",
            key_encoder="sha256",
        )

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/core/tests/unit_tests/indexing/test_indexing.py.
Where is test_incremental_fails_with_bad_source_ids() defined?
test_incremental_fails_with_bad_source_ids() is defined in libs/core/tests/unit_tests/indexing/test_indexing.py at line 570.

Analyze Your Own Codebase

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

Try Supermodel Free