Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 71e69b3

Browse files
authored
Merge pull request #93 from sundy-li/notice-databend-driver
notice databend-driver
2 parents 246e2c5 + 9f990f4 commit 71e69b3

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Notice
2+
We strongly recommend using the [databend-driver](https://pypi.org/project/databend-driver) as it provides more comprehensive features.
3+
4+
15
# databend-py
26

37
Databend Cloud Python Driver with native http interface support

databend_py/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ def _iter_receive_result(self, query, query_id=None, with_column_types=False):
7777
)
7878
_, rows = result.get_result()
7979
for row in rows:
80-
for r in row:
81-
yield r
80+
yield row
8281

8382
def execute(
8483
self, query, params=None, with_column_types=False, query_id=None, settings=None

examples/iter_query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
def iter_query():
55
client = Client.from_url("http://root:root@localhost:8000")
6-
result = client.execute_iter("select 1", with_column_types=False)
6+
result = client.execute_iter("select 1, 2, 3 from numbers(3)", with_column_types=False)
77
result_list = [i for i in result]
8-
# result_list is [1]
8+
# result_list is [(1, 2, 3), (1, 2, 3), (1, 2, 3)]
99
print(result_list)

tests/test_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,11 @@ def test_batch_insert_with_dict_multi_fields(self):
153153

154154
def test_iter_query(self):
155155
client = Client.from_url(self.databend_url)
156-
result = client.execute_iter("select 1", with_column_types=False)
156+
result = client.execute_iter("select 1, 2, 3 from numbers(3)", with_column_types=False)
157157
self.assertIsInstance(result, types.GeneratorType)
158158
result_list = [i for i in result]
159159
print(result_list)
160-
self.assertEqual(result_list, [1])
161-
self.assertEqual(list(result), [])
160+
self.assertEqual(result_list, [(1, 2, 3), (1, 2, 3), (1, 2, 3)])
162161

163162
def test_insert(self):
164163
client = Client.from_url(self.databend_url)

0 commit comments

Comments
 (0)