Skip to content

Commit

Permalink
Attribute rename to allowed_exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Jun 11, 2024
1 parent 1bfcbb5 commit 362951e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/zarr/store/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class RemoteStore(Store):

_fs: AsyncFileSystem
path: str
exceptions: tuple[type[Exception], ...]
allowed_exceptions: tuple[type[Exception], ...]

def __init__(
self,
Expand Down Expand Up @@ -65,7 +65,7 @@ def __init__(
self._fs = url._fs
else:
raise ValueError("URL not understood, %s", url)
self.exceptions = allowed_exceptions
self.allowed_exceptions = allowed_exceptions
# test instantiate file system
if not self._fs.async_impl:
raise TypeError("FileSystem needs to support async operations")
Expand Down Expand Up @@ -103,7 +103,7 @@ async def get(
)
return value

except self.exceptions:
except self.allowed_exceptions:
return None
except OSError as e:
if "not satisfiable" in str(e):
Expand Down Expand Up @@ -131,7 +131,7 @@ async def delete(self, key: str) -> None:
await self._fs._rm(path)
except FileNotFoundError:
pass
except self.exceptions:
except self.allowed_exceptions:
pass

async def exists(self, key: str) -> bool:
Expand Down Expand Up @@ -163,7 +163,7 @@ async def get_partial_values(
# the following is an s3-specific condition we probably don't want to leak
res = [b"" if (isinstance(r, OSError) and "not satisfiable" in str(r)) else r for r in res]
for r in res:
if isinstance(r, Exception) and not isinstance(r, self.exceptions):
if isinstance(r, Exception) and not isinstance(r, self.allowed_exceptions):
raise r

return [None if isinstance(r, Exception) else prototype.buffer.from_bytes(r) for r in res]
Expand Down

0 comments on commit 362951e

Please sign in to comment.