diff options
author | Munyoki Kilyungi | 2022-09-08 14:20:30 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-09-08 14:26:19 +0300 |
commit | 08a937631da94c8158068072d2ce2346c29e9cbe (patch) | |
tree | 954f5be5084d5c1f3ecd4dfc7ee22cb793c6e05f | |
parent | 6abdd5ce8e76452a93613fa5477832bb0b3c3050 (diff) | |
download | genenetwork2-08a937631da94c8158068072d2ce2346c29e9cbe.tar.gz |
Replace "asserts" with ValueErrors
* wqflask/wqflask/api/correlation.py (do_correlation): Raise a
ValueError if variables are not in the start_vars.
-rw-r--r-- | wqflask/wqflask/api/correlation.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/wqflask/wqflask/api/correlation.py b/wqflask/wqflask/api/correlation.py index ab1e772a..9fafc881 100644 --- a/wqflask/wqflask/api/correlation.py +++ b/wqflask/wqflask/api/correlation.py @@ -8,9 +8,12 @@ from wqflask.correlation import correlation_functions from wqflask.database import database_connection def do_correlation(start_vars): - assert('db' in start_vars) - assert('target_db' in start_vars) - assert('trait_id' in start_vars) + if 'db' not in start_vars: + raise ValueError("'db' not found!") + if 'target_db' not in start_vars: + raise ValueError("'target_db' not found!") + if 'trait_id' not in start_vars: + raise ValueError("'trait_id' not found!") this_dataset = data_set.create_dataset(dataset_name=start_vars['db']) target_dataset = data_set.create_dataset( |