@@ -131,9 +131,7 @@ def _ensure_store(store: Any):
131
131
f"wrap it in Zarr.storage.KVStore. Got { store } "
132
132
)
133
133
134
- def getitems (
135
- self , keys : Iterable [str ], meta_array : NDArrayLike , * , on_error : str = "omit"
136
- ) -> Mapping [str , Any ]:
134
+ def getitems (self , keys : Iterable [str ], meta_array : NDArrayLike ) -> Mapping [str , Any ]:
137
135
"""Retrieve data from multiple keys.
138
136
139
137
Parameters
@@ -144,10 +142,6 @@ def getitems(
144
142
An array instance to use for determining the output type. For now, this is
145
143
only a hint and can be ignore by the implementation, in which case the type
146
144
of the output is the same as calling __getitem__() for each key in keys.
147
- on_error : str, optional
148
- The policy on how to handle exceptions when retrieving keys. For now, the
149
- only supported policy is "omit", which means that failing keys are omitted
150
- from the returned result.
151
145
152
146
Returns
153
147
-------
@@ -161,17 +155,7 @@ def getitems(
161
155
reads of multiple keys and/or to utilize the meta_array argument.
162
156
"""
163
157
164
- # Please overwrite `getitems` to support non-default values of `on_error`
165
- if on_error != "omit" :
166
- raise ValueError (f"{ self .__class__ } doesn't support on_error='{ on_error } '" )
167
-
168
- ret = {}
169
- for k in keys :
170
- try :
171
- ret [k ] = self [k ]
172
- except Exception :
173
- pass # Omit keys that fails
174
- return ret
158
+ return {k : self [k ] for k in keys if k in self }
175
159
176
160
177
161
class Store (BaseStore ):
0 commit comments