From 26bbdbc757768f0a3865452765d829d9919ca012 Mon Sep 17 00:00:00 2001 From: cpwu Date: Mon, 16 May 2022 18:44:40 +0800 Subject: [PATCH] fix case --- tests/system-test/2-query/union.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/system-test/2-query/union.py b/tests/system-test/2-query/union.py index 59434e3f2d..a379584a8c 100644 --- a/tests/system-test/2-query/union.py +++ b/tests/system-test/2-query/union.py @@ -99,7 +99,7 @@ class TDTestCase: return join_condition 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"): query_conditon = query_conditon[6:-1] elif query_conditon.startswith("max"): @@ -125,14 +125,15 @@ class TDTestCase: def __group_condition(self, col, having = None): - if col.startswith("count"): - col = col[6:-1] - elif col.startswith("max"): - col = col[4:-1] - elif col.startswith("sum"): - col = col[4:-1] - elif col.startswith("min"): - col = col[4:-1] + if isinstance(col, str): + if col.startswith("count"): + col = col[6:-1] + elif col.startswith("max"): + col = col[4:-1] + elif col.startswith("sum"): + 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} " def __single_sql(self, select_clause, from_clause, where_condition="", group_condition=""): -- GitLab