diff --git a/doc/newsfragments/3178_changed.orjson_opt.rst b/doc/newsfragments/3178_changed.orjson_opt.rst new file mode 100644 index 000000000..7e8e98fd9 --- /dev/null +++ b/doc/newsfragments/3178_changed.orjson_opt.rst @@ -0,0 +1 @@ +Update ``orjson`` dumping option to allow serializing ``numpy`` objects. \ No newline at end of file diff --git a/testplan/common/utils/json.py b/testplan/common/utils/json.py index f18df7c96..e5202d1ce 100644 --- a/testplan/common/utils/json.py +++ b/testplan/common/utils/json.py @@ -24,7 +24,8 @@ def json_dumps(data, indent_2=False, default=None) -> str: return orjson.dumps( data, default=default, - option=orjson.OPT_INDENT_2 if indent_2 else 0, + option=(orjson.OPT_INDENT_2 if indent_2 else 0) + | orjson.OPT_SERIALIZE_NUMPY, ).decode() else: if default: