python: Reformat with Black, except quotes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:19:30 -08:00
committed by Tim Abbott
parent 5028c081cb
commit 11741543da
817 changed files with 44952 additions and 24860 deletions

View File

@@ -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),
)