Skip to content

Commit

Permalink
style: format with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jason810496 committed Nov 3, 2024
1 parent 32e81bd commit 531e403
Show file tree
Hide file tree
Showing 4 changed files with 328 additions and 219 deletions.
4 changes: 2 additions & 2 deletions tembo-pgmq-python/tembo_pgmq_python/sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from tembo_pgmq_python.sqlalchemy.queue import PGMQueue
from tembo_pgmq_python.sqlalchemy.queue import PGMQueue

__all__ = ["PGMQueue"]
__all__ = ["PGMQueue"]
39 changes: 13 additions & 26 deletions tembo-pgmq-python/tembo_pgmq_python/sqlalchemy/_db_api_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,62 +18,49 @@


class DBAPIConnection(Protocol):
def close(self) -> object:
...
def close(self) -> object: ...

def commit(self) -> object:
...
def commit(self) -> object: ...

# optional:
# def rollback(self) -> Any: ...
def cursor(self) -> "DBAPICursor":
...
def cursor(self) -> "DBAPICursor": ...


class DBAPICursor(Protocol):
@property
def description(self) -> Union[Sequence[DBAPIColumnDescription], None]:
...
def description(self) -> Union[Sequence[DBAPIColumnDescription], None]: ...

@property
def rowcount(self) -> int:
...
def rowcount(self) -> int: ...

# optional:
# def callproc(self, procname: str, parameters: Sequence[Any] = ..., /) -> Sequence[Any]: ...
def close(self) -> object:
...
def close(self) -> object: ...

def execute(
self,
operation: str,
parameters: Union[Sequence[Any], Mapping[str, Any]] = ...,
/,
) -> object:
...
) -> object: ...

def executemany(
self, operation: str, seq_of_parameters: Sequence[Sequence[Any]], /
) -> object:
...
) -> object: ...

def fetchone(self) -> Union[Sequence[Any], None]:
...
def fetchone(self) -> Union[Sequence[Any], None]: ...

def fetchmany(self, size: int = ..., /) -> Sequence[Sequence[Any]]:
...
def fetchmany(self, size: int = ..., /) -> Sequence[Sequence[Any]]: ...

def fetchall(self) -> Sequence[Sequence[Any]]:
...
def fetchall(self) -> Sequence[Sequence[Any]]: ...

# optional:
# def nextset(self) -> None | Literal[True]: ...
arraysize: int

def setinputsizes(
self, sizes: Sequence[Union[DBAPITypeCode, int, None]], /
) -> object:
...
) -> object: ...

def setoutputsize(self, size: int, column: int = ..., /) -> object:
...
def setoutputsize(self, size: int, column: int = ..., /) -> object: ...
12 changes: 6 additions & 6 deletions tembo-pgmq-python/tembo_pgmq_python/sqlalchemy/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
SESSION_TYPE = Union[Session, AsyncSession]
PARAM_STYLE_TYPE = Literal["qmark", "numeric", "named", "format", "pyformat"]
DIALECTS_TYPE = Literal[
'sqlalchemy',
'asyncpg',
'psycopg2',
'psycopg3',
"sqlalchemy",
"asyncpg",
"psycopg2",
"psycopg3",
]
STATEMENT_TYPE = Union[Tuple[TextClause, Dict[str, Any]], TextClause]


class AsyncDBAPICursor(DBAPICursor):
async def execute(
self,
operation: str,
parameters: Union[Sequence[Any], Mapping[str, Any]] = ...,
/,
) -> object:
...
) -> object: ...


__all__ = [
Expand Down
Loading

0 comments on commit 531e403

Please sign in to comment.