Skip to content

[fs] not FileNotFoundError for glob patterns#11905

Merged
danking merged 2 commits intohail-is:mainfrom
danking:fix-globbing
Jun 18, 2022
Merged

[fs] not FileNotFoundError for glob patterns#11905
danking merged 2 commits intohail-is:mainfrom
danking:fix-globbing

Conversation

@danking
Copy link
Contributor

@danking danking commented Jun 10, 2022

Currently, if we have a file structure like:

a/
    b/
aa/
    bb/

A glob pattern like */b will raise FileNotFoundError beacuse
we try to list the file or folder named "b" inside aa. We should
not error. We should return ['a/b'].

It is insufficient to avoid FileNotFoundError altogether because
the Hadoop API treats paths without globs differently. In particular,
listing the path aa/b should raise an error.

This change fixes behavior in the first case and treats the second
case explicitly.

Currently, if we have a file structure like:

    a/
        b/
    aa/
        bb/

A glob pattern like `*/b` will raise FileNotFoundError beacuse
we try to list the file or folder named "b" inside `aa`. We should
not error. We should return `[a/b]`.

It is insufficient to avoid FileNotFoundError altogether because
the Hadoop API treats paths without globs differently. In particular,
listing the path `aa/b` should raise an error.

This change fixes behavior in the first case and treats the second
case explicitly.
@danking danking merged commit db98fa0 into hail-is:main Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants