@@ -218,12 +218,7 @@ async def execute(self, query: str, *args, timeout: float=None) -> str:
218
218
_ , status , _ = await self ._execute (query , args , 0 , timeout , True )
219
219
return status .decode ()
220
220
221
- async def executemany (self , command : str , args ,
222
- _timeout : float = None , ** kw ):
223
- # The real signature of this method is:
224
- #
225
- # executemany(self, command: str, args, *, timeout: float=None)
226
- #
221
+ async def executemany (self , command : str , args , * , timeout : float = None ):
227
222
"""Execute an SQL *command* for each sequence of arguments in *args*.
228
223
229
224
Example:
@@ -242,24 +237,6 @@ async def executemany(self, command: str, args,
242
237
.. versionadded:: 0.7.0
243
238
"""
244
239
self ._check_open ()
245
-
246
- if 'timeout' in kw :
247
- timeout = kw .pop ('timeout' )
248
- else :
249
- timeout = _timeout
250
- if timeout is not None :
251
- warnings .warn (
252
- "Passing 'timeout' as a positional argument to "
253
- "executemany() is deprecated and will be removed in "
254
- "asyncpg 0.11.0. Pass it as a keyword argument instead: "
255
- "`executemany(..., timeout=...)`." ,
256
- DeprecationWarning , stacklevel = 2 )
257
- if kw :
258
- first_kwarg = next (iter (kw ))
259
- raise TypeError (
260
- 'executemany() got an unexpected keyword argument {!r}' .format (
261
- first_kwarg ))
262
-
263
240
return await self ._executemany (command , args , timeout )
264
241
265
242
async def _get_statement (self , query , timeout , * , named : bool = False ):
@@ -1290,21 +1267,3 @@ def _detect_server_capabilities(server_version, connection_settings):
1290
1267
sql_reset = sql_reset ,
1291
1268
sql_close_all = sql_close_all
1292
1269
)
1293
-
1294
-
1295
- def _patch_executemany_signature ():
1296
- # Patch Connection.executemany() signature to remove '**kw' parameter
1297
- # and change '_timeout' keyword arg to 'timeout' keyword-only arg.
1298
- # TODO Remove in 0.11.0.
1299
- import inspect
1300
- sig = inspect .signature (Connection .executemany )
1301
- params = sig .parameters .copy ()
1302
- params .pop ('kw' )
1303
- timeout = params .pop ('_timeout' )
1304
- timeout = timeout .replace (name = 'timeout' , kind = timeout .KEYWORD_ONLY )
1305
- params ['timeout' ] = timeout
1306
- Connection .executemany .__signature__ = sig .replace (
1307
- parameters = params .values ())
1308
-
1309
-
1310
- _patch_executemany_signature ()
0 commit comments