Skip to content

Commit b0b5b09

Browse files
committed
Add with_read_only to FsspecStore
1 parent 83c97ac commit b0b5b09

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/zarr/storage/_fsspec.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class FsspecStore(Store):
122122

123123
fs: AsyncFileSystem
124124
allowed_exceptions: tuple[type[Exception], ...]
125+
path: str
125126

126127
def __init__(
127128
self,
@@ -258,6 +259,15 @@ def from_url(
258259

259260
return cls(fs=fs, path=path, read_only=read_only, allowed_exceptions=allowed_exceptions)
260261

262+
def with_read_only(self, read_only: bool = False) -> FsspecStore:
263+
# docstring inherited
264+
return type(self)(
265+
fs=self.fs,
266+
path=self.path,
267+
allowed_exceptions=self.allowed_exceptions,
268+
read_only=read_only,
269+
)
270+
261271
async def clear(self) -> None:
262272
# docstring inherited
263273
try:

0 commit comments

Comments
 (0)