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

implement handling of empty results #228

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

yaseminbridges
Copy link
Contributor

Added a check in the post-processing methods that will print a warning message if there are no results found. This should stop the error @souzadevinicius was getting in his experiments and write out the rest of the results without stopping the entire process.

@yaseminbridges yaseminbridges linked an issue Dec 7, 2023 that may be closed by this pull request
@yaseminbridges yaseminbridges marked this pull request as ready for review December 7, 2023 11:56
@@ -449,6 +449,9 @@ def generate_pheval_result(
Raises:
ValueError: If the results are not all the same type or an error occurs during file writing.
"""
if not pheval_result:
print(f"Warning: No results found for {tool_result_path.name}")
Copy link
Member

Choose a reason for hiding this comment

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

I dont know how far this goes but you should avoid at all time to use print() in favour of logging.warning or logging.info() so that the client can set their preferred reporting levels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

@@ -450,7 +451,7 @@ def generate_pheval_result(
ValueError: If the results are not all the same type or an error occurs during file writing.
"""
if not pheval_result:
print(f"Warning: No results found for {tool_result_path.name}")
info_log.warning(f"No results found for {tool_result_path.name}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this log an error, not a warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn’t sure. I can change it to log an error but I didn’t to begin with because sometimes the tool doesn’t generate results and there isn’t an error with the tool itself

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough.

@julesjacobsen julesjacobsen merged commit 1c6fb25 into main Dec 8, 2023
5 checks passed
@yaseminbridges yaseminbridges deleted the 226-implement-handling-of-empty-results branch December 8, 2023 15:29
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.

Implement handling of empty results
4 participants