Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
taddes committed Nov 29, 2024
1 parent 5fa41e9 commit d2ff740
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
5 changes: 1 addition & 4 deletions tools/spanner/purge_ttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):
Expand Down
4 changes: 1 addition & 3 deletions tools/tokenserver/purge_old_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tools/user_migration/gen_bso_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(":")
Expand Down
2 changes: 1 addition & 1 deletion tools/user_migration/old/migrate_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d2ff740

Please sign in to comment.