Skip to content

Commit f01eeaf

Browse files
committed
Add test for conn.query
1 parent b21b735 commit f01eeaf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_conn_cursor.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ def test_conn_query_without_receiving_result(self):
2020
conn.query("SELECT 1", "Null")
2121
conn.close()
2222

23+
def test_conn_query_df_and_arrowtable(self):
24+
conn = connect()
25+
ret = conn.query("SELECT 123 as x", "DataFrame")
26+
self.assertEqual(ret.x[0], 123)
27+
28+
ret = conn.query("SELECT 123 as x", "ArrowTable")
29+
self.assertEqual(
30+
str(ret),
31+
"""pyarrow.Table
32+
x: uint8 not null
33+
----
34+
x: [[123]]""",
35+
)
36+
conn.close()
37+
2338
def test_basic_operations(self):
2439
conn = connect(":memory:")
2540
cursor = conn.cursor()

0 commit comments

Comments
 (0)