-
Notifications
You must be signed in to change notification settings - Fork 382
FSMap: Strange behavior for check
and create
parameters on S3.
#733
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 recommend removing the |
Sounds good to me. I will fork and get to work on it. Two questions:
|
|
This seems to have become lots. @telamonian , were you intending to work on fixing this? |
Description
We were using the
check
andcreate
parameters to make sure we have write permission to the bucket before we do a lot of time-consuming work.When using
s3fs
backend, and potentially any object store, we are running into this issue. Did some debugging and after some discussions with other contributors, it seems likefsspec
is the right place to handle this behavior.Workflow:
zarr
file. As you may already know azarr
root is a directory.zarr
we want to check if we can access the bucket and write to it.check
andcreate
for convenience. In this case the path we want to create ismy_bucket/my_file.zarr
check
andcreate
when this file (folder) doesn't exist, it still fails.This is because (Also see related discussions at the end):
create
doesn't "really" create a directory, as we would normally create in the cloud console.check
callsfs.exists
which in this case is aS3FileSystem.exists(root)
instance and it returnsFalse
, even though we ran themkdir
before that.Are these checks necessary anymore since backends can raise exceptions related to write permissions?
Or should we handle it differently in
fsspec
to work as expected on cloud backends?Or should the users handle it on their own code?
https://github.com/intake/filesystem_spec/blob/06d1c7c9668377d37137e11dc7db84fee14d2d1b/fsspec/mapping.py#L47-L57
Related Issue/Discussions:
zarr-developers/zarr-python#814
fsspec/s3fs#401 (comment)
@martindurant
The text was updated successfully, but these errors were encountered: