Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Pliner committed Aug 30, 2023
1 parent fad541f commit d42c842
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 6 additions & 2 deletions aiopg/sa/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def __init__(self, connection, engine) -> None:
self._cursors = weakref.WeakSet()
self._query_compile_kwargs = dict(self._QUERY_COMPILE_KWARGS)

def execute(self, query, *multiparams, **params) -> _IterableContextManager[ResultProxy]:
def execute(
self, query, *multiparams, **params
) -> _IterableContextManager[ResultProxy]:
"""Executes a SQL query with optional parameters.
query - a SQL query string or any sqlalchemy expression.
Expand Down Expand Up @@ -232,7 +234,9 @@ def begin(self, isolation_level=None, readonly=False, deferrable=False):
coro, _commit_transaction_if_active, _rollback_transaction
)

async def _begin(self, isolation_level, readonly, deferrable) -> Transaction:
async def _begin(
self, isolation_level, readonly, deferrable
) -> Transaction:
if self._transaction is None:
self._transaction = RootTransaction(self)
await self._begin_impl(isolation_level, readonly, deferrable)
Expand Down
14 changes: 8 additions & 6 deletions aiopg/sa/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def _exec_default(self, default):
return default.arg


def get_dialect(json_serializer=json.dumps, json_deserializer=lambda x: x) -> PGDialect:
def get_dialect(
json_serializer=json.dumps, json_deserializer=lambda x: x
) -> PGDialect:
dialect = PGDialect_psycopg2(
json_serializer=json_serializer, json_deserializer=json_deserializer
)
Expand All @@ -72,7 +74,7 @@ def create_engine(
dialect=_dialect,
timeout=TIMEOUT,
pool_recycle=-1,
**kwargs
**kwargs,
) -> _ContextManager[Engine]:
"""A coroutine for Engine creation.
Expand All @@ -88,7 +90,7 @@ def create_engine(
dialect=dialect,
timeout=timeout,
pool_recycle=pool_recycle,
**kwargs
**kwargs,
)
return _ContextManager(coro, _close_engine)

Expand All @@ -101,7 +103,7 @@ async def _create_engine(
dialect=_dialect,
timeout=TIMEOUT,
pool_recycle=-1,
**kwargs
**kwargs,
) -> Engine:

pool = await aiopg.create_pool(
Expand All @@ -110,7 +112,7 @@ async def _create_engine(
maxsize=maxsize,
timeout=timeout,
pool_recycle=pool_recycle,
**kwargs
**kwargs,
)
conn = await pool.acquire()
try:
Expand Down Expand Up @@ -273,7 +275,7 @@ class _ConnectionContextManager:

__slots__ = ("_conn", "_loop")

def __init__(self, conn: SAConnection, loop: asyncio.AbstractEventLoop) -> None:
def __init__(self, conn: SAConnection, loop: asyncio.AbstractEventLoop):
self._conn = conn
self._loop = loop

Expand Down

0 comments on commit d42c842

Please sign in to comment.