Home / Function/ test_lazy_load() — langchain Function Reference

test_lazy_load() — langchain Function Reference

Architecture documentation for the test_lazy_load() function in test_langsmith.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  99d2da62_046a_95af_6439_af50bc798046["test_lazy_load()"]
  96709919_9cd9_963f_bfc5_49d6081b92d8["test_langsmith.py"]
  99d2da62_046a_95af_6439_af50bc798046 -->|defined in| 96709919_9cd9_963f_bfc5_49d6081b92d8
  style 99d2da62_046a_95af_6439_af50bc798046 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/document_loaders/test_langsmith.py lines 42–62

def test_lazy_load() -> None:
    loader = LangSmithLoader(
        api_key="dummy",
        dataset_id="mock",
        content_key="first.second",
        format_content=(lambda x: x.upper()),
    )
    expected = []
    for example in EXAMPLES:
        example_dict = pydantic_to_dict(example)
        metadata = {
            k: v if not v or isinstance(v, dict) else str(v)
            for k, v in example_dict.items()
        }
        expected.append(
            Document(example.inputs["first"]["second"].upper(), metadata=metadata)
            if example.inputs
            else None
        )
    actual = list(loader.lazy_load())
    assert expected == actual

Subdomains

Frequently Asked Questions

What does test_lazy_load() do?
test_lazy_load() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/document_loaders/test_langsmith.py.
Where is test_lazy_load() defined?
test_lazy_load() is defined in libs/core/tests/unit_tests/document_loaders/test_langsmith.py at line 42.

Analyze Your Own Codebase

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

Try Supermodel Free