mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-09 13:00:34 +00:00
Add lark import error (#7465)
This commit is contained in:
parent
bcab894f4e
commit
04cddfba0d
@ -145,6 +145,11 @@ def get_parser(
|
||||
Returns:
|
||||
Lark parser for the query language.
|
||||
"""
|
||||
# QueryTransformer is None when Lark cannot be imported.
|
||||
if QueryTransformer is None:
|
||||
raise ImportError(
|
||||
"Cannot import lark, please install it with 'pip install lark'."
|
||||
)
|
||||
transformer = QueryTransformer(
|
||||
allowed_comparators=allowed_comparators, allowed_operators=allowed_operators
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user