Home / Function/ test_scoped_full_fails_with_bad_source_ids() — langchain Function Reference

test_scoped_full_fails_with_bad_source_ids() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  83582dbf_c80f_3f59_6d45_784bbdb2aa07["test_scoped_full_fails_with_bad_source_ids()"]
  576ad89d_c8dc_eddf_9cd2_c8ae0e7c9978["test_indexing.py"]
  83582dbf_c80f_3f59_6d45_784bbdb2aa07 -->|defined in| 576ad89d_c8dc_eddf_9cd2_c8ae0e7c9978
  style 83582dbf_c80f_3f59_6d45_784bbdb2aa07 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/indexing/test_indexing.py lines 922–969

def test_scoped_full_fails_with_bad_source_ids(
    record_manager: InMemoryRecordManager, vector_store: InMemoryVectorStore
) -> None:
    """Test Indexing with scoped_full 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="scoped_full",
            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="scoped_full",
            source_id_key="source",
            key_encoder="sha256",
        )

Subdomains

Frequently Asked Questions

What does test_scoped_full_fails_with_bad_source_ids() do?
test_scoped_full_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_scoped_full_fails_with_bad_source_ids() defined?
test_scoped_full_fails_with_bad_source_ids() is defined in libs/core/tests/unit_tests/indexing/test_indexing.py at line 922.

Analyze Your Own Codebase

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

Try Supermodel Free