-
Notifications
You must be signed in to change notification settings - Fork 364
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
Write test to explain behaviour of .info #185
base: master
Are you sure you want to change the base?
Conversation
You are I think right in your expectations, but this has more to do with the implementation of
The test here is a simple Many filesystems have their own implementations of path/directory handling, so the exact behaviour may depend on which one you are considering. |
The one I was using when finding this behaviour was https://github.com/dask/gcsfs/blob/master/gcsfs/core.py#L794 |
Specifically in gcsfs, this has been noted before, but I thought was fixed. The meaning of "prefix" is a little ambiguous, but I would understand the same as you, that you need a path separator next in order to match further names. |
Just to make sure I understand:
|
Correct on your understanding |
Hello! So here Martin is almost certainly correct
The background story is that since I'd be happy to work on the |
Thanks, This weekend I can look into the gcsfs's implementation to see if I can pin point the exact problem I was having. if not FS.exists("directory"):
FS.mkdir("directory")
if not FS.exists("dir"):
FS.mkdir("dir") Creating only if not FS.exists("dir"):
FS.mkdir("dir")
if not FS.exists("directory"):
FS.mkdir("directory") Creating both |
Any progress here? |
I am wondering if this behaviour is intended:
The following describe the tests included in this PR. See for contents of filesystem used in tests
AbstractFileSystem.exists("top_level/second")
will result inTrue
even though the directory only exists assecond_level
.AbstractFileSystem.exists("top_level/second_level/date/")
will also result inTrue
, even though that does not exist as a directory, but"top_level/second_level/date"
prefixes other directory names.AbstractFileSystem.exists("top_level/second_level/date=2019-10-01/a.parq")
will result inTrue
, even though it's doesn't exist as a file, only as a prefix again.And lastly this results in a strange behaviour when doing the following:
My assumption is that this has to do mostly with this line: https://github.com/foxyblue/filesystem_spec/blob/master/fsspec/spec.py#L502 checking for unempty
out
variable.I found this bug by using doing:
Resulting in only
"directory"
to be created, if creating"dir"
was executed first, both folders would be created.