From 9d167a5fa97480d813b16fd1420349af2008071f Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 30 Nov 2023 10:25:02 +0300 Subject: Bug: Fix insertion error Fix a bug that was causing the data insertion to fail. --- scripts/insert_data.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/insert_data.py b/scripts/insert_data.py index 4dbf27c..63e85ef 100644 --- a/scripts/insert_data.py +++ b/scripts/insert_data.py @@ -169,8 +169,7 @@ def insert_probesets(filepath: str, print() cursor.executemany(probeset_query, probeset_params) probeset_names = probeset_names + tuple( - name[0:name.index("::RAND_")] for name in ( - row["Name"] for row in probeset_params)) + row["Name"] for row in probeset_params) return probeset_names @@ -211,9 +210,8 @@ def insert_means(# pylint: disable=[too-many-locals, too-many-arguments] # which means that we cannot have 2 (or more) ProbeSets which share both # the name and chip_id (platform) at the same time. rand_str = f"::RAND_{random_string()}" - pset_ids = {# pylint: disable=[unnecessary-comprehension] - # Look into simply doing dict(probeset_ids(...)) - name: pset_id + pset_ids = { + name[0:name.index("::RAND_")]: pset_id for name, pset_id in probeset_ids( dbconn, platform_id, -- cgit v1.2.3