Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fs] not FileNotFoundError for glob patterns #11905

Merged
merged 2 commits into from
Jun 18, 2022
Merged

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.

None yet

2 participants