diff --git a/batch/batch/driver/main.py b/batch/batch/driver/main.py index 552e9630f13..396a55f0868 100644 --- a/batch/batch/driver/main.py +++ b/batch/batch/driver/main.py @@ -1518,7 +1518,7 @@ async def compact(tx: Transaction, record: dict): await tx.just_execute( f"""\ DELETE FROM job_group_inst_coll_cancellable_resources -WHERE {'AND'.join([f'{k} = %s' for k in keyfields])}; +WHERE {' AND '.join([f'{k} = %s' for k in keyfields])}; """, [record[k] for k in keyfields], ) @@ -1613,7 +1613,7 @@ async def delete_dead_job_group_cancellable_resources_records(db: Database): await db.just_execute( f"""\ DELETE FROM job_group_inst_coll_cancellable_resources -WHERE {'AND'.join([f'{k} = %s' for k in keyfields])}; +WHERE {' AND '.join([f'{k} = %s' for k in keyfields])}; """, [target[k] for k in keyfields], )