mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-29 21:30:18 +00:00
handle single arg to and/or (#5637)
@ryderwishart @eyurtsev thoughts on handling this in the parser itself? related to #5570
This commit is contained in:
@@ -114,3 +114,11 @@ def test_parse_bool_value(x: str) -> None:
|
||||
actual = parsed.value
|
||||
expected = x.lower() == "true"
|
||||
assert actual == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize("op", ("and", "or"))
|
||||
@pytest.mark.parametrize("arg", ('eq("foo", 2)', 'and(eq("foo", 2), lte("bar", 1.1))'))
|
||||
def test_parser_unpack_single_arg_operation(op: str, arg: str) -> None:
|
||||
expected = DEFAULT_PARSER.parse(arg)
|
||||
actual = DEFAULT_PARSER.parse(f"{op}({arg})")
|
||||
assert expected == actual
|
||||
|
||||
Reference in New Issue
Block a user