diff --git a/tools/spanner/purge_ttl.py b/tools/spanner/purge_ttl.py index 92cfcd79ed..e5f0678051 100644 --- a/tools/spanner/purge_ttl.py +++ b/tools/spanner/purge_ttl.py @@ -63,10 +63,7 @@ def deleter( ) end = datetime.now() logging.info( - "{name}: removed {result} rows, {name}_duration: {time}, prefix: {prefix}".format( - name=name, result=result, time=end - start, prefix=prefix - ) - ) + f"{name}: removed {result} rows, {name}_duration: {end - start}, prefix: {prefix}") def add_conditions(args, query: str, prefix: Optional[str]): diff --git a/tools/tokenserver/purge_old_records.py b/tools/tokenserver/purge_old_records.py index ca020a5848..4be7dc116b 100644 --- a/tools/tokenserver/purge_old_records.py +++ b/tools/tokenserver/purge_old_records.py @@ -85,9 +85,7 @@ def purge_old_records( previous_list = rows range_msg = "" if uid_range: - range_msg = ( - f" within range {uid_range[0] or 'Start'}" f" to {uid_range[1] or 'End'}" - ) + range_msg = f" within range {uid_range[0] or 'Start'} to {uid_range[1] or 'End'}" logger.info(f"Fetched {len(rows)} rows at offset {offset}{range_msg}") counter = 0 for row in rows: diff --git a/tools/user_migration/gen_bso_users.py b/tools/user_migration/gen_bso_users.py index 9bedaf13dd..4259f19ef3 100644 --- a/tools/user_migration/gen_bso_users.py +++ b/tools/user_migration/gen_bso_users.py @@ -107,8 +107,8 @@ def run(self, bso_num): try: cursor = connection.cursor() sql = ( - """select userid, count(*) as count from bso{}""" - """ group by userid order by userid""".format(bso_num) + f"""select userid, count(*) as count from bso{bso_num}""" + """ group by userid order by userid""" ) if self.args.user_range: (offset, limit) = self.args.user_range.split(":") diff --git a/tools/user_migration/old/migrate_user.py b/tools/user_migration/old/migrate_user.py index 119a647a36..1e32b43685 100644 --- a/tools/user_migration/old/migrate_user.py +++ b/tools/user_migration/old/migrate_user.py @@ -384,7 +384,7 @@ def spanner_transact(transaction): mod_v, ) ] - logging.debug("### uc: {}".format(uc_columns, uc_values)) + logging.debug(f"### uc: {uc_columns} {uc_values}") transaction.insert("user_collections", columns=uc_columns, values=uc_values) # add the BSO values. if args.full and collection_id == META_GLOBAL_COLLECTION_ID: