-
-
Notifications
You must be signed in to change notification settings - Fork 329
Bug: zarr.open behaves different than zarr.open_group with mode w-
on gs://
URIs
#712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I believe my issue is related: I've tried to create a dataset in s3 (all ok at this step), but if I try to open in any writeable mode ('a', 'r+', 'w-'), zarr forbids writing new datasets with the same error: import zarr
import numpy as np
with zarr.open('s3://mybucket/zarr_experiment.zarr', mode='w') as g:
g['x'] = np.arange(200 * 200).reshape(200, 200).astype('uint16')
print(g['x'][:].sum())
with zarr.open('s3://mybucket/zarr_experiment.zarr', mode='r') as g:
print(list(g))
print(g['x'][:].sum())
with zarr.open('s3://mybucket/zarr_experiment.zarr', mode='a') as g:
print(list(g))
print(g['x'][:].sum())
g['y'] = np.arange(200 * 200).reshape(200, 200).astype('uint16') # <--- this line always fails all printed sums coincide and correct. Error I get:
All fresh: fsspec '2021.10.1', zarr '2.10.3', numcodecs: '0.9.1', mac os, pip, python 3.9. |
@adrianloy's 2.6 version likely discounts #696 (2.9). #660 was added in 2.6.0. Do either of you still know the last version that still worked for you? |
@joshmoore I'm just exploring/testing format and did not use it previously. |
This issue may be fixed by #916 |
@joshmoore nice, I can recheck after PR is merged. Though as of now there is noone assigned to review #916 |
@arogozhnikov, now merged. Let me know how it works for you. |
@joshmoore I am on '2.11.0a3.dev41' and nothing changed, I get
on the same example code above |
Thanks, @arogozhnikov. @martindurant, do you know off hand if should actually be |
I am not certain in this context, but "clobber" ought to mean that any existing dataset is removed before write, right? (not clobber) is not necessarily the same as (read only), so perhaps it's the naming convention that's wrong? |
@joshmoore this change does not help. From the log above you may see that mode somehow transforms to 'r': 1208 if self.mode == 'r':
-> 1209 raise ReadOnlyError() |
@martindurant : hmmm..... that's a good question. From Line 113 in 22ded1d
@arogozhnikov : thanks! |
@arogozhnikov et al.: Another attempted fix was just released with 2.11.1. |
@joshmoore |
whew Thanks @d70-t and @martindurant! (#976) |
The convenient function
zarr.open
does not work to create a zarr group on a gcp bucket with modew-
:Minimal, reproducible code sample:
Problem description
If we use w- mode above code breaks, even if we dont have a group at the URI given:
If we use mode
w
it works. Alsozarr.open_group
works with the URI and the modew-
.From having a quick look, the underlying fsstore seems to be configured in read only mode when we use
zarr.open(gs_uri, mode=w-
).Version and installation information
Please provide the following:
zarr.__version__
2.6.1numcodecs.__version__
0.7.3fsspec.__version__
0.8.7The text was updated successfully, but these errors were encountered: