From 07c94ab13460a2289b386f3a164954ac7920e28c Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 13 Dec 2021 15:53:05 +0300 Subject: Fix errors with query Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Use the correct format string paradigm: put f before opening quote. * Provide missing space just before 'FROM' clause --- gn3/db/correlations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gn3') diff --git a/gn3/db/correlations.py b/gn3/db/correlations.py index 254af10..1743405 100644 --- a/gn3/db/correlations.py +++ b/gn3/db/correlations.py @@ -483,14 +483,14 @@ def fetch_all_database_data(# pylint: disable=[R0913, R0914] sample_id_columns = ", ".join(f"T{smpl}.value" for smpl in sample_ids) if db_type == "Publish": joins = tuple( - ("LEFT JOIN PublishData AS T{item} " - "ON T{item}.Id = PublishXRef.DataId " - "AND T{item}.StrainId = %(T{item}_sample_id)s") + (f"LEFT JOIN PublishData AS T{item} " + f"ON T{item}.Id = PublishXRef.DataId " + f"AND T{item}.StrainId = %(T{item}_sample_id)s") for item in sample_ids) return ( ("SELECT PublishXRef.Id, " + sample_id_columns + - "FROM (PublishXRef, PublishFreeze) " + + " FROM (PublishXRef, PublishFreeze) " + " ".join(joins) + " WHERE PublishXRef.InbredSetId = PublishFreeze.InbredSetId " "AND PublishFreeze.Name = %(db_name)s"), -- cgit v1.2.3