diff options
author | Munyoki Kilyungi | 2022-09-07 12:07:22 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-09-08 14:26:19 +0300 |
commit | b69e6944b45ed1c59e43c7b75571777711b8a30d (patch) | |
tree | 5da6864b7cdb842a39304f76f67243b0446e6e4c /wqflask/base | |
parent | f48d60c1f4ddb222629e19fd42c840a961666334 (diff) | |
download | genenetwork2-b69e6944b45ed1c59e43c7b75571777711b8a30d.tar.gz |
Remove redundant cursor.fetchone()
* wqflask/base/data_set.py (DataSet.retrieve_other_names): Call
cursor.fetchone() only once.
Diffstat (limited to 'wqflask/base')
-rw-r--r-- | wqflask/base/data_set.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 470aa28b..cd626526 100644 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -650,18 +650,16 @@ class DataSet: "ProbeSetFreeze.FullName = %s " "OR ProbeSetFreeze.ShortName = %s)", (self.name,)*3) - (self.id, self.name, self.fullname, self.shortname, - self.data_scale, self.tissue) = cursor.fetchone() else: + self.tissue = "N/A" cursor.execute( "SELECT Id, Name, FullName, ShortName " f"FROM {self.type}Freeze " "WHERE (Name = %s OR FullName = " "%s OR ShortName = %s)", (self.name,)*3) - (self.id, self.name, self.fullname, self.shortname, - self.data_scale, self.tissue) = cursor.fetchone() - self.tissue = "N/A" + (self.id, self.name, self.fullname, self.shortname, + self.data_scale, self.tissue) = cursor.fetchone() except TypeError: pass |