From a88225fcffe893c9b265bd0cbf3a5e166c2bae6f Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Wed, 12 Feb 2025 14:46:29 +0000 Subject: [PATCH] Added check to wrap string into list to prevent decomposing string for querying --- src/autobigs/engine/data/remote/databases/bigsdb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/autobigs/engine/data/remote/databases/bigsdb.py b/src/autobigs/engine/data/remote/databases/bigsdb.py index 206a9f1..116a73f 100644 --- a/src/autobigs/engine/data/remote/databases/bigsdb.py +++ b/src/autobigs/engine/data/remote/databases/bigsdb.py @@ -47,10 +47,13 @@ class OnlineBIGSdbMLSTProfiler(BIGSdbMLSTProfiler): async def __aenter__(self): return self - async def fetch_mlst_allele_variants(self, sequence_strings: Iterable[str]) -> AsyncGenerator[Allele, Any]: + async def fetch_mlst_allele_variants(self, sequence_strings: Union[Iterable[str], str]) -> AsyncGenerator[Allele, Any]: # See https://bigsdb.pasteur.fr/api/db/pubmlst_bordetella_seqdef/schemes uri_path = "sequence" + if isinstance(sequence_strings, str): + sequence_strings = [sequence_strings] + for sequence_string in sequence_strings: async with self._http_client.post(uri_path, json={ "sequence": sequence_string,