From c2b93065da00ff6777ff48b7844adeb82ec65eda Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 13 Oct 2025 13:29:46 -0500 Subject: Fix linting errors. --- uploader/phenotypes/models.py | 12 +++++++----- uploader/publications/models.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/uploader/phenotypes/models.py b/uploader/phenotypes/models.py index b30f624..e40155f 100644 --- a/uploader/phenotypes/models.py +++ b/uploader/phenotypes/models.py @@ -321,10 +321,12 @@ def __pre_process_phenotype_data__(row): } -def create_new_phenotypes(conn: mdb.Connection, - population_id: int, - publication_id: int, - phenotypes: Iterable[dict]) -> tuple[dict, ...]: +def create_new_phenotypes(# pylint: disable=[too-many-locals] + conn: mdb.Connection, + population_id: int, + publication_id: int, + phenotypes: Iterable[dict] +) -> tuple[dict, ...]: """Add entirely new phenotypes to the database. WARNING: Not thread-safe.""" _phenos = tuple() with conn.cursor(cursorclass=DictCursor) as cursor: @@ -393,7 +395,7 @@ def create_new_phenotypes(conn: mdb.Connection, for row in cursor.fetchall()) if len(existing) > 0: # Narrow this exception, perhaps? - raise Exception( + raise Exception(# pylint: disable=[broad-exception-raised] "Found already existing phenotypes with the following " "'Pre-publication abbreviations':\n\t" "\n\t".join(f"* {item}" for item in existing)) diff --git a/uploader/publications/models.py b/uploader/publications/models.py index ba8f026..dcfa02b 100644 --- a/uploader/publications/models.py +++ b/uploader/publications/models.py @@ -85,7 +85,7 @@ def delete_publications(conn: Connection , publications: tuple[dict, ...]): cursor.execute(_phenos_query, _pub_ids) _linked_phenos = cursor.fetchall() if len(_linked_phenos) > 0: - raise Exception( + raise Exception(# pylint: disable=[broad-exception-raised] "Cannot delete publications with linked phenotypes.") cursor.execute( -- cgit 1.4.1