From 5f80fe74a43fe1743851c9bd9840ed97afd8420d Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 11 Jun 2024 21:55:43 +0000 Subject: Raise ValueError if dataset type isn't ProbeSet/Publish/Geno --- gn2/wqflask/search_results.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gn2/wqflask/search_results.py b/gn2/wqflask/search_results.py index 0bdeb958..67cebf56 100644 --- a/gn2/wqflask/search_results.py +++ b/gn2/wqflask/search_results.py @@ -445,8 +445,8 @@ def generate_xapian_request(dataset, search_terms, and_or): search_type = "phenotype" case "Geno": search_type = "genotype" - case _: # This should never happen, not sure if it's necessary - search_type = "gene" + case _: # This should never happen + raise ValueError(f"Dataset types should only be ProbeSet, Publish, or Geno, not '{dataset.type}'") xapian_terms = and_or.join([create_xapian_term(dataset, term) for term in search_terms]) -- cgit v1.2.3