diff options
author | BonfaceKilz | 2022-03-02 15:47:52 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-03-12 15:33:09 +0300 |
commit | af1d36e0847d2bcd878ea7343bd1c858ae4fa91f (patch) | |
tree | e7d0ac7a02ff7037c6a1c0f6c68f3060cb596adf | |
parent | c8fd4f85e735f1654f44f5a0b3d939b34e708208 (diff) | |
download | genenetwork3-af1d36e0847d2bcd878ea7343bd1c858ae4fa91f.tar.gz |
Fix faulty SQL query string when deleting case-attributes
-rw-r--r-- | gn3/db/sample_data.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gn3/db/sample_data.py b/gn3/db/sample_data.py index 3d2faca..80f8292 100644 --- a/gn3/db/sample_data.py +++ b/gn3/db/sample_data.py @@ -197,13 +197,12 @@ def delete_sample_data(conn: Any, if value != "x": with conn.cursor() as cursor: cursor.execute( - ("DELETE FROM CaseAttributeXRefNew " - "WHERE StrainId = " - "(SELECT CaseAttributeId FROM " - f"CaseAttribute WHERE NAME = %s) " - "AND InbredSetId = %s"), - (strain_id, case_attr, inbredset_id) - ) + "DELETE FROM CaseAttributeXRefNew " + "WHERE StrainId = %s AND CaseAttributeId = " + "(SELECT CaseAttributeId FROM " + "CaseAttribute WHERE Name = %s) " + "AND InbredSetId = %s", + (strain_id, case_attr, inbredset_id)) return cursor.rowcount return 0 |