Skip to content

Fix listing files in BucketFS for empty bucket (-location) #251

@ckunki

Description

@ckunki

For listing files in the BucketFS or one of its folders, BFS provides method PathLike.iterdir().

When creating a list of all the filenames, iterdir() will be called one or multiple times:

names = [f.name for f in bfs_location.iterdir()]

If the specified BucketFS location is empty, BFSPY raises a FileNotFoundError:
https://github.com/exasol/bucketfs-python/blob/main/exasol/bucketfs/_path.py#L450

The current ticket therefore proposes to

  • either change the existing method in order to return an empty iterator
  • or raise a more specific error and add a convenience method catching this error and returning an empty iterator

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProduct feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions