You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.
If the file given in the --jsonfile parameter already exists, reporting/convert-results.py fails with:
Traceback (most recent call last):
File "mondo-sam/reporting/convert_results.py", line 135, in <module>
convert_results_to_csv(json_objects, args.csvfile)
File "mondo-sam/reporting/convert_results.py", line 62, in convert_results_to_csv
keys = set(result["Case"].keys())
TypeError: list indices must be integers, not str
The text was updated successfully, but these errors were encountered:
Based on the error message, it seems like the Python script cannot parse a json file properly. Note that the convert-results.py script tries to parse every json file that are located in the given directory (given by the -s argument), therefore, one malformed json file can terminate the whole operation. Basically, the keys = set(result["Case"].keys()) statement searches a Case key in the result Map. However, according to the error message, it handles the result object as a List instead of a Map, since it requires a list index instead of a string key.
I see two options. First, one of the json file is empty or malformed due to the fact that the framework didn't save any results. This scenario can occur when your concrete Scenario object doesn't instantiate a CaseDescriptor in its build() method. Second, you saved the merged json file to the same directory where the original (individual) results were found, and thus, by running the converter script again you actually tried to parse the previously merged json file causing this anomaly.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If the file given in the
--jsonfile
parameter already exists,reporting/convert-results.py
fails with:The text was updated successfully, but these errors were encountered: