From b5cfd2380604c2d4c664965c694fe9153345e183 Mon Sep 17 00:00:00 2001 From: John Readey Date: Tue, 1 Oct 2024 08:11:08 -0500 Subject: [PATCH] check server version with fancyselections (#223) --- h5pyd/_hl/dataset.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/h5pyd/_hl/dataset.py b/h5pyd/_hl/dataset.py index ac07e37..e1d0c88 100644 --- a/h5pyd/_hl/dataset.py +++ b/h5pyd/_hl/dataset.py @@ -1191,6 +1191,20 @@ def __getitem__(self, args, new_dtype=None): elif isinstance(selection, sel.FancySelection): select = selection.getQueryParam() + num_coords = 0 + for s in select: + if isinstance(s, list): + num_coords += 1 + if num_coords > 1: + # multi coordinates are only supported with recent HSDS versions, so check first + server_ver = self.id.http_conn.server_version() + if server_ver and server_ver.startswith("0.9") or server_ver.startswith("1."): + pass # ok + else: + msg = "Fancy selection with multiple coordinates is only supported in HSDS 0.9+" + self.log.warn(msg) + raise IOError(msg) + params["select"] = select MAX_SELECT_QUERY_LEN = 100 if len(select) > MAX_SELECT_QUERY_LEN: