gcsfs
gcsfs copied to clipboard
Improve folder detection in _info
A suggestion to fix https://github.com/dask/gcsfs/issues/312.
What happens if you both have the empty placeholder and nested directories?
This should be tested for the cases that:
- nothing has been listed yet
- that the directory in question has been listed
- that the parent directory has been listed.
With this change, is is still true that info(path) == ls(path)[0] in all cases?
You mean in case there is /foo and /foo/? Or /foo/ and /foo/bar?
I'll add some test cases at the end of the week, can't answer these out of my head.
At the moment (with or without this PR) the behaviour seems to be incorrect as ls is returning ["foo", "foo"].
You mean in case there is /foo and /foo/? Or /foo/ and /foo/bar?
I suppose both those problematic cases :|
ls is returning ["foo", "foo"]
If you do with detail=True, then one of these is presumably the folder, the other the file. So it's not exactly wrong. Whether or not there should be a "/" suffix is another question.
@dynamix @martindurant Any updates on the PR? The inconsistency is causing issues for us while working on remote filesystems. Ref
I would like some additional tests for each of the cases I listed above. It's not obvious to me from the code alone that every case will pass.