Skip to content
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

Fix async cursor fetch methods #74

Merged
merged 1 commit into from
Feb 19, 2025
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
max-parallel: 4
matrix:
python-version: [3.9]
environment: [test]
folder: [ydb_sqlalchemy, test]
environment: [test-unit, test-dialect]

steps:
- uses: actions/checkout@v1
Expand All @@ -34,4 +33,4 @@ jobs:
python -m pip install --upgrade pip
pip install tox==4.2.6
- name: Run unit tests
run: tox -e ${{ matrix.environment }} -- ${{ matrix.folder }}
run: tox -e ${{ matrix.environment }}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sqlalchemy >= 1.4.0, < 3.0.0
ydb >= 3.18.8
ydb-dbapi >= 0.1.7
ydb-dbapi >= 0.1.8
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = test,test-all,test-dbapi,test-unit,black,black-format,style,coverage
envlist = test,test-all,test-dialect,test-unit,black,black-format,style,coverage
minversion = 4.2.6
skipsdist = True
ignore_basepython_conflict = true
Expand Down Expand Up @@ -29,6 +29,13 @@ commands =
pytest -v ydb_sqlalchemy
docker-compose down -v

[testenv:test-dialect]
commands =
docker-compose up -d
python {toxinidir}/wait_container_ready.py
pytest -v test --dbdriver ydb --dbdriver ydb_async
docker-compose down -v

[testenv:test-unit]
commands =
pytest -v {toxinidir}/ydb_sqlalchemy
Expand Down
6 changes: 3 additions & 3 deletions ydb_sqlalchemy/sqlalchemy/dbapi_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ def rowcount(self):
return self._cursor.rowcount

def fetchone(self):
return await_only(self._cursor.fetchone())
return self._cursor.fetchone()

def fetchmany(self, size=None):
return await_only(self._cursor.fetchmany(size=size))
return self._cursor.fetchmany(size=size)

def fetchall(self):
return await_only(self._cursor.fetchall())
return self._cursor.fetchall()

def execute_scheme(self, sql, parameters=None):
return await_only(self._cursor.execute_scheme(sql, parameters))
Expand Down