Skip to content

Info call makes unnecessary long listing for "directories" #656

@shcheklein

Description

@shcheklein

When path is a "directory" (prefix) we might end up going into full listing operation to just get an info for a single path. We call ls and we don't pass any limits (and it seems GCSFS doesn't support max results atm?).

        out = await self._ls(path, **kwargs)  # Here we can go into a long listing since we don't limit it
        out0 = [o for o in out if o["name"].rstrip("/") == path]
        if out0:
            # exact hit
            return out0[0]
        elif out:
            # other stuff - must be a directory

Is it intentional for some reason?

On s3 and Azure, in similar place we list to check if at least a single key exists (we don't check for an exact hit).

Can we drop the exact hit check and pass max results into ls?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions