-
Notifications
You must be signed in to change notification settings - Fork 845
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 metadata to json decode errors #2860
Conversation
Signed-off-by: Andrew Brain <andrewbrain2019@gmail.com>
@@ -0,0 +1,8 @@ | |||
class MetadataException(Exception): |
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.
[pylint] reported by reviewdog 🐶
C0114: Missing module docstring (missing-module-docstring)
@@ -0,0 +1,8 @@ | |||
class MetadataException(Exception): |
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.
[pylint] reported by reviewdog 🐶
C0115: Missing class docstring (missing-class-docstring)
@@ -11,6 +11,9 @@ | |||
import json |
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.
[pylint] reported by reviewdog 🐶
W0404: Reimport 'json' (imported line 2) (reimported)
@@ -11,6 +11,9 @@ | |||
import json | |||
import subprocess | |||
|
|||
from augur.tasks.util.metadata_exception import MetadataException | |||
|
|||
|
|||
def create_grouped_task_load(*args,processes=8,dataList=[],task=None): |
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.
[pylint] reported by reviewdog 🐶
W0102: Dangerous default value [] as argument (dangerous-default-value)
@@ -141,7 +144,7 @@ def parse_json_from_subprocess_call(logger, subprocess_arr, cwd=None): | |||
required_output = {} | |||
except json.decoder.JSONDecodeError as e: | |||
logger.error(f"Could not parse required output! \n output: {output} \n Error: {e}") | |||
raise e | |||
raise MetadataException(e, f"output : {output}") |
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.
[pylint] reported by reviewdog 🐶
W0707: Consider explicitly re-raising using 'raise MetadataException(e, f'output : {output}') from e' (raise-missing-from)
@@ -11,6 +11,9 @@ | |||
import json |
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.
[pylint] reported by reviewdog 🐶
C0412: Imports from package json are not grouped (ungrouped-imports)
Signed-off-by: Andrew Brain <andrewbrain2019@gmail.com>
Signed-off-by: Andrew Brain <andrewbrain2019@gmail.com>
|
||
except Exception as e: | ||
|
||
raise MetadataException(e, f"required_output: {required_output}") |
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.
[pylint] reported by reviewdog 🐶
W0707: Consider explicitly re-raising using 'raise MetadataException(e, f'required_output: {required_output}') from e' (raise-missing-from)
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.
LGTM
Description
parse_json_from_subprocess_call
but it is impossible to find these logs in the huge log files so I added the exception so that the relevant data will show up in flowerSigned commits