Home / Function/ test_default_transform_with_dicts() — langchain Function Reference

test_default_transform_with_dicts() — langchain Function Reference

Architecture documentation for the test_default_transform_with_dicts() function in test_runnable.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  34b41caf_bce7_6131_f777_50c1c77b2f37["test_default_transform_with_dicts()"]
  26df6ad8_0189_51d0_c3c1_6c3248893ff5["test_runnable.py"]
  34b41caf_bce7_6131_f777_50c1c77b2f37 -->|defined in| 26df6ad8_0189_51d0_c3c1_6c3248893ff5
  fb618d44_c03b_ea8b_385b_2278dfb173d4["invoke()"]
  34b41caf_bce7_6131_f777_50c1c77b2f37 -->|calls| fb618d44_c03b_ea8b_385b_2278dfb173d4
  style 34b41caf_bce7_6131_f777_50c1c77b2f37 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_runnable.py lines 5505–5524

def test_default_transform_with_dicts() -> None:
    """Test that default transform works with dicts."""

    class CustomRunnable(RunnableSerializable[Input, Output]):
        @override
        def invoke(
            self, input: Input, config: RunnableConfig | None = None, **kwargs: Any
        ) -> Output:
            return cast("Output", input)

    runnable = CustomRunnable[dict[str, str], dict[str, str]]()
    chunks = iter(
        [
            {"foo": "a"},
            {"foo": "n"},
        ]
    )

    assert list(runnable.transform(chunks)) == [{"foo": "n"}]
    assert list(runnable.stream({"foo": "n"})) == [{"foo": "n"}]

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_default_transform_with_dicts() do?
test_default_transform_with_dicts() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_runnable.py.
Where is test_default_transform_with_dicts() defined?
test_default_transform_with_dicts() is defined in libs/core/tests/unit_tests/runnables/test_runnable.py at line 5505.
What does test_default_transform_with_dicts() call?
test_default_transform_with_dicts() calls 1 function(s): invoke.

Analyze Your Own Codebase

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

Try Supermodel Free