Skip to content

Commit 3a5991c

Browse files
committed
fixed flake8 issues
1 parent a01486d commit 3a5991c

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

asyncpg/connection.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ async def execute(self, query: str, *args, timeout: float=None) -> str:
277277
_, status, _ = await self._execute(query, args, 0, timeout, True)
278278
return status.decode()
279279

280-
async def executemany(self, command: str, args, *, timeout: float=None) -> None:
280+
async def executemany(self, command: str, args, *, timeout: float=None) \
281+
-> None:
281282
"""Execute an SQL *command* for each sequence of arguments in *args*.
282283
283284
Example:
@@ -380,7 +381,8 @@ async def _introspect_types(self, typeoids, timeout):
380381
return await self.__execute(
381382
self._intro_query, (list(typeoids),), 0, timeout)
382383

383-
def cursor(self, query, *args, prefetch=None, timeout=None) -> cursor.CursorFactory:
384+
def cursor(self, query, *args, prefetch=None, timeout=None) \
385+
-> cursor.CursorFactory:
384386
"""Return a *cursor factory* for the specified query.
385387
386388
:param args: Query arguments.
@@ -394,7 +396,8 @@ def cursor(self, query, *args, prefetch=None, timeout=None) -> cursor.CursorFact
394396
return cursor.CursorFactory(self, query, None, args,
395397
prefetch, timeout)
396398

397-
async def prepare(self, query, *, timeout=None) -> prepared_stmt.PreparedStatement:
399+
async def prepare(self, query, *, timeout=None) \
400+
-> prepared_stmt.PreparedStatement:
398401
"""Create a *prepared statement* for the specified query.
399402
400403
:param str query: Text of the query to create a prepared statement for.
@@ -410,7 +413,8 @@ async def _prepare(self, query, *, timeout=None, use_cache: bool=False):
410413
use_cache=use_cache)
411414
return prepared_stmt.PreparedStatement(self, query, stmt)
412415

413-
async def fetch(self, query, *args, timeout=None) -> typing.List[protocol.Record]:
416+
async def fetch(self, query, *args, timeout=None) \
417+
-> typing.List[protocol.Record]:
414418
"""Run a query and return the results as a list of :class:`Record`.
415419
416420
:param str query: Query text.
@@ -422,7 +426,8 @@ async def fetch(self, query, *args, timeout=None) -> typing.List[protocol.Record
422426
self._check_open()
423427
return await self._execute(query, args, 0, timeout)
424428

425-
async def fetchval(self, query, *args, column=0, timeout=None) -> typing.Any:
429+
async def fetchval(self, query, *args, column=0, timeout=None) \
430+
-> typing.Any:
426431
"""Run a query and return a value in the first row.
427432
428433
:param str query: Query text.
@@ -443,7 +448,8 @@ async def fetchval(self, query, *args, column=0, timeout=None) -> typing.Any:
443448
return None
444449
return data[0][column]
445450

446-
async def fetchrow(self, query, *args, timeout=None) -> typing.Optional[protocol.Record]:
451+
async def fetchrow(self, query, *args, timeout=None) \
452+
-> typing.Optional[protocol.Record]:
447453
"""Run a query and return the first row.
448454
449455
:param str query: Query text
@@ -463,7 +469,8 @@ async def copy_from_table(self, table_name, *, output,
463469
columns=None, schema_name=None, timeout=None,
464470
format=None, oids=None, delimiter=None,
465471
null=None, header=None, quote=None,
466-
escape=None, force_quote=None, encoding=None) -> str:
472+
escape=None, force_quote=None, encoding=None) \
473+
-> str:
467474
"""Copy table contents to a file or file-like object.
468475
469476
:param str table_name:

asyncpg/pool.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ async def execute(self, query: str, *args, timeout: float=None) -> str:
510510
async with self.acquire() as con:
511511
return await con.execute(query, *args, timeout=timeout)
512512

513-
async def executemany(self, command: str, args, *, timeout: float=None) -> None:
513+
async def executemany(self, command: str, args, *, timeout: float=None) \
514+
-> None:
514515
"""Execute an SQL *command* for each sequence of arguments in *args*.
515516
516517
Pool performs this operation using one of its connections. Other than
@@ -522,7 +523,8 @@ async def executemany(self, command: str, args, *, timeout: float=None) -> None:
522523
async with self.acquire() as con:
523524
return await con.executemany(command, args, timeout=timeout)
524525

525-
async def fetch(self, query, *args, timeout=None) -> typing.List[protocol.Record]:
526+
async def fetch(self, query, *args, timeout=None) \
527+
-> typing.List[protocol.Record]:
526528
"""Run a query and return the results as a list of :class:`Record`.
527529
528530
Pool performs this operation using one of its connections. Other than
@@ -534,7 +536,8 @@ async def fetch(self, query, *args, timeout=None) -> typing.List[protocol.Record
534536
async with self.acquire() as con:
535537
return await con.fetch(query, *args, timeout=timeout)
536538

537-
async def fetchval(self, query, *args, column=0, timeout=None) -> typing.Any:
539+
async def fetchval(self, query, *args, column=0, timeout=None) \
540+
-> typing.Any:
538541
"""Run a query and return a value in the first row.
539542
540543
Pool performs this operation using one of its connections. Other than
@@ -547,7 +550,8 @@ async def fetchval(self, query, *args, column=0, timeout=None) -> typing.Any:
547550
return await con.fetchval(
548551
query, *args, column=column, timeout=timeout)
549552

550-
async def fetchrow(self, query, *args, timeout=None) -> typing.Optional[protocol.Record]:
553+
async def fetchrow(self, query, *args, timeout=None) \
554+
-> typing.Optional[protocol.Record]:
551555
"""Run a query and return the first row.
552556
553557
Pool performs this operation using one of its connections. Other than

asyncpg/prepared_stmt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ async def fetchval(self, *args, column=0, timeout=None) -> typing.Any:
185185
return data[0][column]
186186

187187
@connresource.guarded
188-
async def fetchrow(self, *args, timeout=None) -> typing.Optional[protocol.Record]:
188+
async def fetchrow(self, *args, timeout=None) \
189+
-> typing.Optional[protocol.Record]:
189190
"""Execute the statement and return the first row.
190191
191192
:param str query: Query text

0 commit comments

Comments
 (0)