Simply calling execute_values in order to appease mypy
mypy was getting upset as it thought 'fetch' was being passed multiple times to execute_values. This cannot happen, as fetch would never be part of 'args', and thus seems like a bug in mypy. This code was a bit strange anyhow. Why collect values with *x only to expand them again immediately afterwards when calling execute_values? The code is simpler now IMO, and appeases mypy.
This commit is contained in:
@@ -300,7 +300,9 @@ class LoggingTransaction:
|
||||
from psycopg2.extras import execute_values # type: ignore
|
||||
|
||||
return self._do_execute(
|
||||
lambda *x: execute_values(self.txn, *x, fetch=fetch), sql, *args
|
||||
lambda sql, argslist: execute_values(self.txn, sql, argslist, fetch=fetch),
|
||||
sql,
|
||||
*args,
|
||||
)
|
||||
|
||||
def execute(self, sql: str, *args: Any) -> None:
|
||||
|
||||
Reference in New Issue
Block a user