mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
python: Reformat with Black, except quotes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
5028c081cb
commit
11741543da
@@ -7,18 +7,22 @@ from psycopg2.sql import SQL, Composable, Identifier
|
||||
CursorObj = TypeVar('CursorObj', bound=cursor)
|
||||
|
||||
|
||||
def do_batch_update(cursor: CursorObj,
|
||||
table: str,
|
||||
assignments: List[Composable],
|
||||
batch_size: int=10000,
|
||||
sleep: float=0.1) -> None: # nocoverage
|
||||
def do_batch_update(
|
||||
cursor: CursorObj,
|
||||
table: str,
|
||||
assignments: List[Composable],
|
||||
batch_size: int = 10000,
|
||||
sleep: float = 0.1,
|
||||
) -> None: # nocoverage
|
||||
# The string substitution below is complicated by our need to
|
||||
# support multiple PostgreSQL versions.
|
||||
stmt = SQL('''
|
||||
stmt = SQL(
|
||||
'''
|
||||
UPDATE {}
|
||||
SET {}
|
||||
WHERE id >= %s AND id < %s
|
||||
''').format(
|
||||
'''
|
||||
).format(
|
||||
Identifier(table),
|
||||
SQL(', ').join(assignments),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user