Skip to content

Commit 706f6f1

Browse files
committed
Fix async cursor fetch methods
1 parent 2eacadb commit 706f6f1

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

.github/workflows/tests.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
max-parallel: 4
2020
matrix:
2121
python-version: [3.9]
22-
environment: [test]
23-
folder: [ydb_sqlalchemy, test]
22+
environment: [test-unit, test-dialect]
2423

2524
steps:
2625
- uses: actions/checkout@v1
@@ -34,4 +33,4 @@ jobs:
3433
python -m pip install --upgrade pip
3534
pip install tox==4.2.6
3635
- name: Run unit tests
37-
run: tox -e ${{ matrix.environment }} -- ${{ matrix.folder }}
36+
run: tox -e ${{ matrix.environment }}

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sqlalchemy >= 1.4.0, < 3.0.0
22
ydb >= 3.18.8
3-
ydb-dbapi >= 0.1.7
3+
ydb-dbapi >= 0.1.8

tox.ini

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = test,test-all,test-dbapi,test-unit,black,black-format,style,coverage
2+
envlist = test,test-all,test-dialect,test-unit,black,black-format,style,coverage
33
minversion = 4.2.6
44
skipsdist = True
55
ignore_basepython_conflict = true
@@ -29,6 +29,13 @@ commands =
2929
pytest -v ydb_sqlalchemy
3030
docker-compose down -v
3131

32+
[testenv:test-dialect]
33+
commands =
34+
docker-compose up -d
35+
python {toxinidir}/wait_container_ready.py
36+
pytest -v test --dbdriver ydb --dbdriver ydb_async
37+
docker-compose down -v
38+
3239
[testenv:test-unit]
3340
commands =
3441
pytest -v {toxinidir}/ydb_sqlalchemy

ydb_sqlalchemy/sqlalchemy/dbapi_adapter.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ def rowcount(self):
8787
return self._cursor.rowcount
8888

8989
def fetchone(self):
90-
return await_only(self._cursor.fetchone())
90+
return self._cursor.fetchone()
9191

9292
def fetchmany(self, size=None):
93-
return await_only(self._cursor.fetchmany(size=size))
93+
return self._cursor.fetchmany(size=size)
9494

9595
def fetchall(self):
96-
return await_only(self._cursor.fetchall())
96+
return self._cursor.fetchall()
9797

9898
def execute_scheme(self, sql, parameters=None):
9999
return await_only(self._cursor.execute_scheme(sql, parameters))

0 commit comments

Comments
 (0)