Skip to content

Commit 23c1c39

Browse files
committed
Fix implicit-option
1 parent d0797f1 commit 23c1c39

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

asyncpg/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def is_in_transaction(self):
311311
"""
312312
return self._protocol.is_in_transaction()
313313

314-
async def execute(self, query: str, *args, timeout: float=None) -> str:
314+
async def execute(self, query: str, *args, timeout: typing.Optional[float]=None) -> str:
315315
"""Execute an SQL command (or commands).
316316
317317
This method can execute many SQL commands at once, when no arguments
@@ -358,7 +358,7 @@ async def execute(self, query: str, *args, timeout: float=None) -> str:
358358
)
359359
return status.decode()
360360

361-
async def executemany(self, command: str, args, *, timeout: float=None):
361+
async def executemany(self, command: str, args, *, timeout: typing.Optional[float]=None):
362362
"""Execute an SQL *command* for each sequence of arguments in *args*.
363363
364364
Example:
@@ -757,7 +757,7 @@ async def fetchrow(
757757
return data[0]
758758

759759
async def fetchmany(
760-
self, query, args, *, timeout: float=None, record_class=None
760+
self, query, args, *, timeout: typing.Optional[float]=None, record_class=None
761761
):
762762
"""Run a query for each sequence of arguments in *args*
763763
and return the results as a list of :class:`Record`.

asyncpg/pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ async def _get_new_connection(self):
574574

575575
return con
576576

577-
async def execute(self, query: str, *args, timeout: float=None) -> str:
577+
async def execute(self, query: str, *args, timeout: Optional[float]=None) -> str:
578578
"""Execute an SQL command (or commands).
579579
580580
Pool performs this operation using one of its connections. Other than
@@ -586,7 +586,7 @@ async def execute(self, query: str, *args, timeout: float=None) -> str:
586586
async with self.acquire() as con:
587587
return await con.execute(query, *args, timeout=timeout)
588588

589-
async def executemany(self, command: str, args, *, timeout: float=None):
589+
async def executemany(self, command: str, args, *, timeout: Optional[float]=None):
590590
"""Execute an SQL *command* for each sequence of arguments in *args*.
591591
592592
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
@@ -6,6 +6,7 @@
66

77

88
import json
9+
import typing
910

1011
from . import connresource
1112
from . import cursor
@@ -232,7 +233,7 @@ async def fetchmany(self, args, *, timeout=None):
232233
)
233234

234235
@connresource.guarded
235-
async def executemany(self, args, *, timeout: float=None):
236+
async def executemany(self, args, *, timeout: typing.Optional[float]=None):
236237
"""Execute the statement for each sequence of arguments in *args*.
237238
238239
:param args: An iterable containing sequences of arguments.

0 commit comments

Comments
 (0)