From 6e36de08896209b61e8c2396956efd8709062bc0 Mon Sep 17 00:00:00 2001 From: wuaho Date: Fri, 30 Jul 2021 19:25:12 +0800 Subject: [PATCH] =?UTF-8?q?gm=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/x_analysis.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/models/x_analysis.py b/models/x_analysis.py index bdcf332..cba17d2 100644 --- a/models/x_analysis.py +++ b/models/x_analysis.py @@ -109,9 +109,11 @@ class XAnalysis: where_str = sql.split('WHERE ')[1] where_order = self.handler_filts() - qry = sa.select().where(*where_order) - sql = str(qry.compile(compile_kwargs={"literal_binds": True})) - where_order_str = sql.split('WHERE ')[1] + where_order_str = 1 + if where_order: + qry = sa.select().where(*where_order) + sql = str(qry.compile(compile_kwargs={"literal_binds": True})) + where_order_str = sql.split('WHERE ')[1] sql = f"""SELECT toString(reg.date) as date, cnt1,