gcsfs icon indicating copy to clipboard operation
gcsfs copied to clipboard

Improve folder detection in _info

Open dynamix opened this issue 4 years ago • 5 comments

A suggestion to fix https://github.com/dask/gcsfs/issues/312.

dynamix avatar Nov 30 '20 19:11 dynamix

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?

martindurant avatar Nov 30 '20 19:11 martindurant

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"].

dynamix avatar Nov 30 '20 20:11 dynamix

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.

martindurant avatar Nov 30 '20 20:11 martindurant

@dynamix @martindurant Any updates on the PR? The inconsistency is causing issues for us while working on remote filesystems. Ref

kaushikb11 avatar Jun 08 '21 23:06 kaushikb11

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.

martindurant avatar Jun 11 '21 13:06 martindurant