Home / Function/ test_parse_comparison() — langchain Function Reference

test_parse_comparison() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/chains/query_constructor/test_parser.py lines 25–38

def test_parse_comparison() -> None:
    comp = 'gte("foo", 2)'
    expected = Comparison(comparator=Comparator.GTE, attribute="foo", value=2)
    for text in (
        comp,
        comp.replace('"', "'"),
        comp.replace(" ", ""),
        comp.replace(" ", "  "),
        comp.replace("(", " ("),
        comp.replace(",", ", "),
        comp.replace("2", "2.0"),
    ):
        actual = DEFAULT_PARSER.parse(text)
        assert expected == actual

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free