diff options
-rw-r--r-- | scripts/load_phenotypes_to_db.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py index 4b6bc9a..360cfbb 100644 --- a/scripts/load_phenotypes_to_db.py +++ b/scripts/load_phenotypes_to_db.py @@ -212,6 +212,8 @@ def cross_reference_phenotypes_publications_and_data( with conn.cursor(cursorclass=DictCursor) as cursor: cursor.execute("SELECT MAX(Id) CurrentMaxId FROM PublishXRef") _nextid = int(cursor.fetchone()["CurrentMaxId"]) + 1 + _params = tuple({**row, "xref_id": _id} + for _id, row in enumerate(xref_data, start=_nextid)) cursor.executemany( ("INSERT INTO PublishXRef(" "Id, InbredSetId, PhenotypeId, PublicationId, DataId, comments" @@ -219,11 +221,9 @@ def cross_reference_phenotypes_publications_and_data( "VALUES (" "%(xref_id)s, %(population_id)s, %(phenotype_id)s, " "%(publication_id)s, %(data_id)s, 'Upload of new data.'" - ") " - "RETURNING *"), - tuple({**row, "xref_id": _id} - for _id, row in enumerate(xref_data, start=_nextid))) - return tuple(dict(row) for row in cursor.fetchall()) + ")"), + _params) + return _params return tuple() |