Skip to content

Commit

Permalink
getitems(): handle on_error="omit"
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Sep 13, 2022
1 parent 89fa599 commit f05ee3a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions zarr/_storage/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,13 @@ def getitems(
if on_error != "omit":
raise ValueError(f"{self.__class__} doesn't support on_error='{on_error}'")

# Please overwrite `getitems` to support non-default values of `meta_array`
return {k: self[k] for k in keys if k in self}
ret = {}
for k in keys:
try:
ret[k] = self[k]
except Exception:
pass # Omit keys that fails
return ret


class Store(BaseStore):
Expand Down

0 comments on commit f05ee3a

Please sign in to comment.