-
Notifications
You must be signed in to change notification settings - Fork 83
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
[bugfix] wrap read metadata.json in a try except block #466
base: master
Are you sure you want to change the base?
Conversation
try: | ||
parameters = json.load(json_data) | ||
except json.decoder.JSONDecodeError: | ||
logger.warning(f"{self._states_file} was empty") |
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.
This should not have potential to create a log flood since the str is constant.
Keeping the level=warning
since we'd ideally want feedback if this behavior is seen by the customers too often
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.
Open to opinions.
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.
In what case would the states file be empty? If it's because of a user misconfiguration of some sort, then yes I agree with making this a warning message. Otherwise, I'm not sure. What are the repercussions for the user if the states file is empty?
Codecov Report
@@ Coverage Diff @@
## master #466 +/- ##
==========================================
- Coverage 65.62% 65.21% -0.42%
==========================================
Files 172 162 -10
Lines 13260 12918 -342
==========================================
- Hits 8702 8424 -278
+ Misses 4558 4494 -64
Continue to review full report at Codecov.
|
Description of changes:
metadata.json
file is empty there is potential that the hook will crash.Style and formatting:
I have run
pre-commit install
to ensure that auto-formatting happens with every commit.Issue number, if available
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.