Home / Function/ test_parse_nested_operation() — langchain Function Reference

test_parse_nested_operation() — langchain Function Reference

Architecture documentation for the test_parse_nested_operation() function in test_parser.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  381aa456_d534_4355_fb07_177224b66528["test_parse_nested_operation()"]
  064e0ca3_1663_b885_96b9_052c91c4e115["test_parser.py"]
  381aa456_d534_4355_fb07_177224b66528 -->|defined in| 064e0ca3_1663_b885_96b9_052c91c4e115
  style 381aa456_d534_4355_fb07_177224b66528 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py lines 59–69

def test_parse_nested_operation() -> None:
    op = 'and(or(eq("a", "b"), eq("a", "c"), eq("a", "d")), not(eq("z", "foo")))'
    eq1 = Comparison(comparator=Comparator.EQ, attribute="a", value="b")
    eq2 = Comparison(comparator=Comparator.EQ, attribute="a", value="c")
    eq3 = Comparison(comparator=Comparator.EQ, attribute="a", value="d")
    eq4 = Comparison(comparator=Comparator.EQ, attribute="z", value="foo")
    _not = Operation(operator=Operator.NOT, arguments=[eq4])
    _or = Operation(operator=Operator.OR, arguments=[eq1, eq2, eq3])
    expected = Operation(operator=Operator.AND, arguments=[_or, _not])
    actual = DEFAULT_PARSER.parse(op)
    assert expected == actual

Domain

Subdomains

Frequently Asked Questions

What does test_parse_nested_operation() do?
test_parse_nested_operation() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py.
Where is test_parse_nested_operation() defined?
test_parse_nested_operation() is defined in libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py at line 59.

Analyze Your Own Codebase

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

Try Supermodel Free