diff options
author | Frederick Muriuki Muriithi | 2021-12-13 15:53:05 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2021-12-13 15:53:05 +0300 |
commit | 07c94ab13460a2289b386f3a164954ac7920e28c (patch) | |
tree | d8e91949199bd5aabcb48a18c86f09e8e3066381 | |
parent | 4f8042a67cab94384bb30e73ec5139fdd3a4c8b5 (diff) | |
download | genenetwork3-07c94ab13460a2289b386f3a164954ac7920e28c.tar.gz |
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
-rw-r--r-- | gn3/db/correlations.py | 8 |
1 files changed, 4 insertions, 4 deletions
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"), |