diff --git a/tests/test_query_py.py b/tests/test_query_py.py index 0cfbef67693..cd2eaba3ce9 100644 --- a/tests/test_query_py.py +++ b/tests/test_query_py.py @@ -88,14 +88,33 @@ def test_query_arrow2(self): # ) # self.assertEqual(str(ret), EXPECTED) - # def test_query_dict(self): - # data = { - # "a": [1, 2, 3, 4, 5, 6], - # "b": ["tom", "jerry", "auxten", "tom", "jerry", "auxten"], - # } + def test_query_dict(self): + data = { + "a": [1, 2, 3, 4, 5, 6], + "b": ["tom", "jerry", "auxten", "tom", "jerry", "auxten"], + } - # ret = chdb.query("SELECT b, sum(a) FROM Python(data) GROUP BY b ORDER BY b") - # self.assertEqual(str(ret), EXPECTED) + ret = chdb.query( + "SELECT b, sum(a) FROM Python(data) GROUP BY b ORDER BY b", "debug" + ) + self.assertEqual(str(ret), EXPECTED) + + def test_query_dict_int(self): + data = { + "a": [1, 2, 3, 4, 5, 6], + "b": [1, 2, 3, 1, 2, 3], + } + + ret = chdb.query( + "SELECT b, sum(a) FROM Python(data) GROUP BY b ORDER BY b", "debug" + ) + self.assertEqual( + str(ret), + """1,5 +2,7 +3,9 +""", + ) if __name__ == "__main__":