Home / Function/ test_parse_operation() — langchain Function Reference

test_parse_operation() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py lines 41–56

def test_parse_operation() -> None:
    op = 'and(eq("foo", "bar"), lt("baz", 1995.25))'
    eq = Comparison(comparator=Comparator.EQ, attribute="foo", value="bar")
    lt = Comparison(comparator=Comparator.LT, attribute="baz", value=1995.25)
    expected = Operation(operator=Operator.AND, arguments=[eq, lt])
    for text in (
        op,
        op.replace('"', "'"),
        op.replace(" ", ""),
        op.replace(" ", "  "),
        op.replace("(", " ("),
        op.replace(",", ", "),
        op.replace("25", "250"),
    ):
        actual = DEFAULT_PARSER.parse(text)
        assert expected == actual

Domain

Subdomains

Frequently Asked Questions

What does test_parse_operation() do?
test_parse_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_operation() defined?
test_parse_operation() is defined in libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py at line 41.

Analyze Your Own Codebase

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

Try Supermodel Free