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

Add protection for no input files #893

Merged
merged 8 commits into from
Oct 8, 2024

Conversation

gonzaponte
Copy link
Collaborator

Currently, there is a protection against not specifying files_in. However, if we do set this variable, but it does not correspond to a valid file or files through globbing, the city will silently finish causing confusion. This PR fixes that.

@jwaiton
Copy link
Collaborator

jwaiton commented Oct 3, 2024

A good PR that passes all tests and works as intended :)

One oddity I noticed is that if you provide two input files, one non-existent and one good, it will not throw up any complaints about the first (or second, ordering doesnt matter) missing file. Should this be filed under a new/separate issue?

@gonzaponte
Copy link
Collaborator Author

Good catch. No, it should at least let you know. I will add a test and fix it.

Now if any pattern fails, we raise a FileNotFoundError earlier in the
process, instead of checking if all of them failed at the end.
@gonzaponte gonzaponte force-pushed the protect-no-input-files branch from 882ee2d to 5fc13d1 Compare October 3, 2024 18:41
Copy link
Collaborator

@jwaiton jwaiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds protections for the case in which malformed input files are provided to the city, which previously caused the city to stop silently with no information provided. Good job!

@jwaiton jwaiton merged commit d25eb48 into next-exp:master Oct 8, 2024
1 check passed
@gonzaponte gonzaponte deleted the protect-no-input-files branch October 8, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants