chore: enforce more ruff rules (#31447)

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
Maxime Beauchemin
2024-12-18 17:41:34 -08:00
committed by GitHub
parent 9da65d6bfd
commit e51b95ffa8
375 changed files with 1821 additions and 1718 deletions

View File

@@ -39,7 +39,7 @@ class QueryPruneCommand(BaseCommand):
Attributes:
retention_period_days (int): The number of days for which records should be retained.
Records older than this period will be deleted.
"""
""" # noqa: E501
def __init__(self, retention_period_days: int):
"""
@@ -83,7 +83,7 @@ class QueryPruneCommand(BaseCommand):
# Update the total number of deleted records
total_deleted += result.rowcount
# Explicitly commit the transaction given that if an error occurs, we want to ensure that the
# Explicitly commit the transaction given that if an error occurs, we want to ensure that the # noqa: E501
# records that have been deleted so far are committed
db.session.commit()
@@ -91,7 +91,7 @@ class QueryPruneCommand(BaseCommand):
percentage_complete = (total_deleted / total_rows) * 100
if percentage_complete >= next_logging_threshold:
logger.info(
"Deleted %s rows from the query table older than %s days (%d%% complete)",
"Deleted %s rows from the query table older than %s days (%d%% complete)", # noqa: E501
total_deleted,
self.retention_period_days,
percentage_complete,