From f348a78900e3f68161162d128c1c2f51482b4525 Mon Sep 17 00:00:00 2001 From: randersenyb Date: Wed, 24 Jul 2024 16:05:03 -0700 Subject: [PATCH] Added guard rail in Big ANN so that only KNN datasets can be converted... --- aerospike/bigann/bigann_convert.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aerospike/bigann/bigann_convert.py b/aerospike/bigann/bigann_convert.py index 0b7f6425..81d1ada6 100644 --- a/aerospike/bigann/bigann_convert.py +++ b/aerospike/bigann/bigann_convert.py @@ -96,6 +96,9 @@ async def bigann_getinfo(self) -> None: self._bigann_searchtype = str(self._bigann_ds.search_type()) self._bigann_default_search_count = int(self._bigann_ds.default_count()) + if self._bigann_searchtype != "knn": + raise ValueError(f"The Big ANN Dataset {self._bigann_ds.short_name()} is defined with a type of {self._bigann_searchtype}. Conversion only supports 'KNN'.") + async def create_hdf(self) -> None: import h5py from string import digits