-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
@@ -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}") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
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.