From 1555014e8f5d3fb94590b6e8793f4f2df7ff4c27 Mon Sep 17 00:00:00 2001 From: John Davis Date: Thu, 25 Apr 2024 14:27:48 -0400 Subject: [PATCH] Fix linting --- scripts/cleanup_database/history_table_pruner.py | 8 +++++--- scripts/cleanup_database/test/conftest.py | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/cleanup_database/history_table_pruner.py b/scripts/cleanup_database/history_table_pruner.py index ab9e646cf269..aa4a06df3b84 100644 --- a/scripts/cleanup_database/history_table_pruner.py +++ b/scripts/cleanup_database/history_table_pruner.py @@ -52,7 +52,7 @@ def run(self): Due to the very large size of some tables, we run operations in batches, using low/high history id as boundaries. """ if self.min_id is None: - logging.info(f"No histories exist") + logging.info("No histories exist") return low = self.min_id @@ -90,7 +90,9 @@ def _run_batch(self, low, high): self._drop_tmp_table() def _get_min_max_ids(self): - stmt = text(f"SELECT min(id), max(id) FROM history WHERE user_id IS NULL AND hid_counter = 1 AND create_time < :create_time") + stmt = text( + "SELECT min(id), max(id) FROM history WHERE user_id IS NULL AND hid_counter = 1 AND create_time < :create_time" + ) params = {"create_time": self.max_create_time} with self.engine.begin() as conn: minmax = conn.execute(stmt, params).all() @@ -100,7 +102,7 @@ def _mark_histories_as_deleted_and_purged(self, low, high): """Mark target histories as deleted and purged to prevent their further usage.""" logging.info(f"Marking histories {low}-{high} as deleted and purged") stmt = text( - f""" + """ UPDATE history SET deleted = TRUE, purged = TRUE WHERE user_id IS NULL AND hid_counter = 1 AND create_time < :create_time AND id >= :low AND id < :high diff --git a/scripts/cleanup_database/test/conftest.py b/scripts/cleanup_database/test/conftest.py index 5b41696bf3d9..35ca1c84d653 100644 --- a/scripts/cleanup_database/test/conftest.py +++ b/scripts/cleanup_database/test/conftest.py @@ -10,8 +10,6 @@ from sqlalchemy.orm import Session from galaxy import model as m -from galaxy.datatypes.registry import Registry as DatatypesRegistry -from galaxy.model.triggers.update_audit_table import install as install_timestamp_triggers # utility fixtures