From a22e0ea9553ea39e7b324306e0d9026311ba8125 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 2 Sep 2024 09:41:12 +0300 Subject: Fix type error. * gn3/api/metadata_api/wiki.py: Remove FIXME comment. * gn3/db/wiki.py: Fix type error. Signed-off-by: Munyoki Kilyungi --- gn3/db/wiki.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gn3/db') diff --git a/gn3/db/wiki.py b/gn3/db/wiki.py index 7c58459..7ef5e68 100644 --- a/gn3/db/wiki.py +++ b/gn3/db/wiki.py @@ -9,7 +9,7 @@ class MissingDBDataException(Exception): """Error due to DB missing some data""" -def get_latest_comment(connection, comment_id: str) -> int: +def get_latest_comment(connection, comment_id: int) -> int: """ Latest comment is one with the highest versionId """ cursor = connection.cursor(DictCursor) query = """ SELECT versionId AS version, symbol, PubMed_ID AS pubmed_ids, sp.Name AS species, @@ -19,7 +19,7 @@ def get_latest_comment(connection, comment_id: str) -> int: WHERE gr.Id = %s ORDER BY versionId DESC LIMIT 1; """ - cursor.execute(query, (comment_id,)) + cursor.execute(query, (str(comment_id),)) result = cursor.fetchone() result["pubmed_ids"] = [x.strip() for x in result["pubmed_ids"].split()] categories_query = """ -- cgit v1.2.3