Skip to content

Commit

Permalink
Merge pull request #1191 from phenobarbital/refactor-2.7-scylladb
Browse files Browse the repository at this point in the history
fixing dependencies and some tests
  • Loading branch information
phenobarbital authored Aug 7, 2024
2 parents 16f0858 + 4ad025d commit 2414c80
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion asyncdb/drivers/outputs/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Returning a asyncdb Record row Format.
"""
import logging
from ...meta import Record
from ...meta.record import Record
from .base import OutputFormat


Expand Down
2 changes: 1 addition & 1 deletion asyncdb/drivers/outputs/recordset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Returning a asyncdb Recordset Result Format.
"""
import logging
from ...meta import Recordset
from ...meta.recordset import Recordset
from .base import OutputFormat


Expand Down
2 changes: 1 addition & 1 deletion asyncdb/drivers/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from ..utils.encoders import (
BaseEncoder,
)
from ..meta import Recordset
from asyncdb.meta.recordset import Recordset
from .sql import SQLDriver

# from .abstract import BaseCursor
Expand Down
2 changes: 1 addition & 1 deletion asyncdb/drivers/sa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from sqlalchemy.exc import DatabaseError, OperationalError, SQLAlchemyError, ProgrammingError, InvalidRequestError
from sqlalchemy import text
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession
from ..meta import Record
from asyncdb.meta.record import Record
from ..exceptions import (
EmptyStatement,
NoDataFound,
Expand Down
4 changes: 2 additions & 2 deletions asyncdb/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from functools import partial
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from datamodel.exceptions import ValidationError
from .meta import Record, Recordset
from .meta.record import Record
from .exceptions import default_exception_handler, DriverError, EmptyStatement
from .models import Model, Field, is_missing, is_dataclass
from .utils.types import Entity, SafeDict
Expand Down Expand Up @@ -465,7 +465,7 @@ async def execute_many(self, sentence: list, *args) -> Optional[Any]:
"""

@abstractmethod
async def query(self, sentence: Union[str, list], **kwargs) -> Optional[Recordset]:
async def query(self, sentence: Union[str, list], **kwargs) -> Optional[Sequence]:
"""queryrow.
Making a Query and returns a resultset.
Expand Down
7 changes: 0 additions & 7 deletions asyncdb/meta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
"""
Meta Objects for records and recordset for AsyncDB.
"""
from .record import Record
from .recordset import Recordset

__all__ = [
"Record",
"Recordset",
]
1 change: 0 additions & 1 deletion asyncdb/meta/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""
from collections.abc import MutableMapping, Iterator
from typing import Any, Union
from google.cloud.bigquery import Row


class Record(MutableMapping):
Expand Down
2 changes: 1 addition & 1 deletion asyncdb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__title__ = "asyncdb"
__description__ = "Library for Asynchronous data source connections \
Collection of asyncio drivers."
__version__ = "2.7.16"
__version__ = "2.7.17"
__author__ = "Jesus Lara"
__author_email__ = "[email protected]"
__license__ = "BSD"
5 changes: 3 additions & 2 deletions tests/test_aiosqlite.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import asyncio
import pytest
from asyncdb import AsyncDB
import polars as pl
import datatable as dt
from asyncdb.meta import Record, Recordset
from asyncdb import AsyncDB
from asyncdb.meta.record import Record
from asyncdb.meta.recordset import Recordset

DRIVER = "sqlite"
PARAMS = {"database": ":memory:"}
Expand Down
3 changes: 2 additions & 1 deletion tests/test_asyncpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import pandas
import polars as pl
import datatable as dt
from asyncdb.meta import Record, Recordset
from asyncdb.meta.record import Record
from asyncdb.meta.recordset import Recordset

DRIVER = 'pg'
DSN = "postgres://troc_pgdata:[email protected]:5432/navigator"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from io import BytesIO
from pathlib import Path
import pytest_asyncio
from asyncdb.meta import Record, Recordset
from asyncdb.meta.record import Record
from asyncdb.meta.recordset import Recordset

DRIVER = 'postgres'
DSN = "postgres://troc_pgdata:[email protected]:5432/navigator"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_rethink.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import pytest_asyncio
import pandas
import datatable as dt
from asyncdb.meta import Record, Recordset
from asyncdb.meta.record import Record
from asyncdb.meta.recordset import Recordset
from asyncdb import AsyncDB

DRIVER = 'rethink'
Expand Down
5 changes: 3 additions & 2 deletions tests/test_sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import pytest_asyncio
import polars as pl
import datatable as dt
from asyncdb.meta import Record, Recordset
from asyncdb.meta.record import Record
from asyncdb.meta.recordset import Recordset

DRIVER = "sql_alchemy"
PARAMS = {
Expand Down Expand Up @@ -35,7 +36,7 @@ async def test_connect(event_loop):
result, error = conn.test_connection()
pytest.assume(result.one == 1)
assert db.is_closed() is True

async def test_connect_by_dsn(event_loop):
db = AsyncDB(DRIVER, dsn=DSN, loop=event_loop)
pytest.assume(db.is_connected() is False)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_sqlserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import pytest_asyncio
import pandas
import datatable as dt
from asyncdb.meta import Record, Recordset
from asyncdb.meta.record import Record
from asyncdb.meta.recordset import Recordset

DRIVER = 'sqlserver'
params = {
Expand Down

0 comments on commit 2414c80

Please sign in to comment.