Skip to content

Commit

Permalink
check server version with fancyselections (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey authored Oct 1, 2024
1 parent 93853f2 commit b5cfd23
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions h5pyd/_hl/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b5cfd23

Please sign in to comment.