diff --git a/bindings/python/tests/asyncio/steps/binding.py b/bindings/python/tests/asyncio/steps/binding.py index 5426d280..dea02924 100644 --- a/bindings/python/tests/asyncio/steps/binding.py +++ b/bindings/python/tests/asyncio/steps/binding.py @@ -203,3 +203,33 @@ async def _(context): expected = [(1), (2)] assert ret == expected, f"ret: {ret}" await context.conn.exec("DROP TABLE temp_1") + + await context.conn.exec(""" + CREATE OR REPLACE TEMP TABLE temp_2 ( + i64 Int64, + u64 UInt64, + f64 Float64, + s String, + s2 String, + d Date, + t DateTime + ) as select 1, number + 1,3, '4', '5', today(), now() from numbers(3) +""") + rows = await context.conn.query_iter("SELECT i64, u64 FROM temp_2") + ret = [row.values() for row in rows] + expected = [ + ( + 1, + 1, + ), + ( + 1, + 2, + ), + ( + 1, + 3, + ), + ] + assert ret == expected, f"ret: {ret}" + await context.conn.exec("DROP TABLE temp_2") diff --git a/bindings/python/tests/blocking/steps/binding.py b/bindings/python/tests/blocking/steps/binding.py index 4f8f7f9b..1a6ea175 100644 --- a/bindings/python/tests/blocking/steps/binding.py +++ b/bindings/python/tests/blocking/steps/binding.py @@ -181,11 +181,41 @@ def _(context): @then("Temp table should work with cluster") -async def _(context): +def _(context): context.conn.exec("create or replace temp table temp_1(a int)") context.conn.exec("INSERT INTO temp_1 VALUES (1),(2)") rows = context.conn.query_iter("SELECT * FROM temp_1") ret = [row.values() for row in rows] - expected = [(1), (2)] + expected = [(1,), (2,)] assert ret == expected, f"ret: {ret}" context.conn.exec("DROP TABLE temp_1") + + context.conn.exec(""" + CREATE OR REPLACE TEMP TABLE temp_2 ( + i64 Int64, + u64 UInt64, + f64 Float64, + s String, + s2 String, + d Date, + t DateTime + ) as select 1, number + 1,3, '4', '5', today(), now() from numbers(3) +""") + rows = context.conn.query_iter("SELECT i64, u64 FROM temp_2") + ret = [row.values() for row in rows] + expected = [ + ( + 1, + 1, + ), + ( + 1, + 2, + ), + ( + 1, + 3, + ), + ] + assert ret == expected, f"ret: {ret}" + context.conn.exec("DROP TABLE temp_2")