This output doesn't follow JSON format, particularly because it uses single quotes ' instead of double quotes ", and because it uses True and False instead of true and false. Therefore, attempting to parse it using, for example, jq, results in an error:
parse error: Invalid numeric literal at line 1, column 20
This PR fixes this issue by ensuring that the output from get_scoring_info is JSON-serializable.
Additionally, since the primary use case of this method is communicating information with a JSON decoder, this PR updates the unit tests for get_scoring_info to use json.loads instead of ast.literal_eval.
This code fixes a bug where the output printed by
get_scoring_info
is not JSON-serializable. In particular, running a simple command like:prints:
This output doesn't follow JSON format, particularly because it uses single quotes
'
instead of double quotes"
, and because it usesTrue
andFalse
instead oftrue
andfalse
. Therefore, attempting to parse it using, for example,jq
, results in an error:results in:
This PR fixes this issue by ensuring that the output from
get_scoring_info
is JSON-serializable.Additionally, since the primary use case of this method is communicating information with a JSON decoder, this PR updates the unit tests for
get_scoring_info
to usejson.loads
instead ofast.literal_eval
.