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

NPI-3501 better empty input file checks #54

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

treefern
Copy link
Collaborator

These changes should help to avoid misleading downstream errors caused by empty files, which are currently not detected at the file reading stage.

  • path2bytes() now raises exceptions on all errors rather than returning None. It also raises an EOFError if the input data is empty. It has also been restructured slightly for clarity and type checking.
  • read_sp3() now accepts a Path or bytes input in addition to a path as str. It now writes an empty string into the 'path' attribute if the input was passed as bytes.

- path2bytes() now raises exceptions on all errors rather than returning None. It also raises an EOFError if the input data is empty. It has also been restructured slightly for clarity and type checking.
- read_sp3() now accepts a Path or bytes input, and writes an empty string into the 'path' attribute if the input was passed as bytes.
@treefern treefern requested a review from ronaldmaj September 10, 2024 07:13
@treefern treefern self-assigned this Sep 10, 2024
…ile exceptions (which was the initial motivation for this whole branch).
Copy link
Collaborator

@ronaldmaj ronaldmaj left a comment

Choose a reason for hiding this comment

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

Awesome, we discussed this a bit in person, and it's looking great 👍
This will definitely help in debugging issues in Ops a lot quicker

@ronaldmaj ronaldmaj merged commit a5f90ff into main Sep 11, 2024
4 checks passed
@ronaldmaj ronaldmaj deleted the NPI-3501-better-empty-input-file-checks branch September 11, 2024 23:55
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