From aac404a86afe838049dae9fb21622330c90badbf Mon Sep 17 00:00:00 2001 From: "codeflash-ai[bot]" <148906541+codeflash-ai[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 06:39:54 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Speed=20up=20visit=5Fstruc?= =?UTF-8?q?tured=5Fquery=20by=201,948%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../langchain/retrievers/self_query/myscale.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/langchain/langchain/retrievers/self_query/myscale.py b/libs/langchain/langchain/retrievers/self_query/myscale.py index a951272471e55..99a0f3be90e68 100644 --- a/libs/langchain/langchain/retrievers/self_query/myscale.py +++ b/libs/langchain/langchain/retrievers/self_query/myscale.py @@ -117,9 +117,9 @@ def visit_comparison(self, comparison: Comparison) -> Dict: def visit_structured_query( self, structured_query: StructuredQuery ) -> Tuple[str, dict]: - print(structured_query) - if structured_query.filter is None: - kwargs = {} - else: - kwargs = {"where_str": structured_query.filter.accept(self)} + kwargs = ( + {"where_str": structured_query.filter.accept(self)} + if structured_query.filter is not None + else {} + ) return structured_query.query, kwargs