Skip to content

chore: temp table tests #642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions bindings/python/tests/asyncio/steps/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
34 changes: 32 additions & 2 deletions bindings/python/tests/blocking/steps/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading