Home / Function/ test_config_passthrough() — langchain Function Reference

test_config_passthrough() — langchain Function Reference

Architecture documentation for the test_config_passthrough() function in test_configurable.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e8478035_5b6c_f4bd_6c00_fd0d3765567c["test_config_passthrough()"]
  ec7909ee_ece0_2780_95cd_f0c5229fc46d["test_configurable.py"]
  e8478035_5b6c_f4bd_6c00_fd0d3765567c -->|defined in| ec7909ee_ece0_2780_95cd_f0c5229fc46d
  52678a78_ef5f_195a_cb54_4c667a93774e["my_custom_function()"]
  e8478035_5b6c_f4bd_6c00_fd0d3765567c -->|calls| 52678a78_ef5f_195a_cb54_4c667a93774e
  cd1de384_a13b_a91a_7bed_d86ffbf38e59["my_custom_function_w_config()"]
  e8478035_5b6c_f4bd_6c00_fd0d3765567c -->|calls| cd1de384_a13b_a91a_7bed_d86ffbf38e59
  style e8478035_5b6c_f4bd_6c00_fd0d3765567c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_configurable.py lines 127–160

def test_config_passthrough() -> None:
    runnable = MyRunnable(my_property="a")
    configurable_runnable = runnable.configurable_fields(
        my_property=ConfigurableField(
            id="my_property",
            name="My property",
            description="The property to test",
        )
    )
    # first one
    with pytest.raises(AttributeError):
        configurable_runnable.not_my_custom_function()  # type: ignore[attr-defined]

    assert configurable_runnable.my_custom_function() == "a"  # type: ignore[attr-defined]
    assert (
        configurable_runnable.my_custom_function_w_config(  # type: ignore[attr-defined]
            {"configurable": {"my_property": "b"}}
        )
        == "b"
    )
    assert (
        configurable_runnable.my_custom_function_w_config(  # type: ignore[attr-defined]
            config={"configurable": {"my_property": "b"}}
        )
        == "b"
    )

    # second one
    assert (
        configurable_runnable.with_config(
            configurable={"my_property": "b"}
        ).my_custom_function()  # type: ignore[attr-defined]
        == "b"
    )

Subdomains

Frequently Asked Questions

What does test_config_passthrough() do?
test_config_passthrough() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_configurable.py.
Where is test_config_passthrough() defined?
test_config_passthrough() is defined in libs/core/tests/unit_tests/runnables/test_configurable.py at line 127.
What does test_config_passthrough() call?
test_config_passthrough() calls 2 function(s): my_custom_function, my_custom_function_w_config.

Analyze Your Own Codebase

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

Try Supermodel Free