提交 26bbdbc7 编写于 作者: C cpwu

fix case

上级 ed76cad0
...@@ -99,7 +99,7 @@ class TDTestCase: ...@@ -99,7 +99,7 @@ class TDTestCase:
return join_condition return join_condition
def __where_condition(self, col=None, tbname=None, query_conditon=None): def __where_condition(self, col=None, tbname=None, query_conditon=None):
if query_conditon: if query_conditon and isinstance(query_conditon, str):
if query_conditon.startswith("count"): if query_conditon.startswith("count"):
query_conditon = query_conditon[6:-1] query_conditon = query_conditon[6:-1]
elif query_conditon.startswith("max"): elif query_conditon.startswith("max"):
...@@ -125,14 +125,15 @@ class TDTestCase: ...@@ -125,14 +125,15 @@ class TDTestCase:
def __group_condition(self, col, having = None): def __group_condition(self, col, having = None):
if col.startswith("count"): if isinstance(col, str):
col = col[6:-1] if col.startswith("count"):
elif col.startswith("max"): col = col[6:-1]
col = col[4:-1] elif col.startswith("max"):
elif col.startswith("sum"): col = col[4:-1]
col = col[4:-1] elif col.startswith("sum"):
elif col.startswith("min"): col = col[4:-1]
col = col[4:-1] elif col.startswith("min"):
col = col[4:-1]
return f" group by {col} having {having}" if having else f" group by {col} " return f" group by {col} having {having}" if having else f" group by {col} "
def __single_sql(self, select_clause, from_clause, where_condition="", group_condition=""): def __single_sql(self, select_clause, from_clause, where_condition="", group_condition=""):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册