We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c32b273 + 2c2671d commit f97d7e2Copy full SHA for f97d7e2
dialog_test/flowtest.py
@@ -1,3 +1,4 @@
1
+import json
2
import os
3
import sys
4
import flowtest_v1
@@ -112,9 +113,10 @@ def processFile(flowfile:str, watsonSDKVersion:str):
112
113
114
# Json is a list. So you save differently.
115
filename = os.path.join(OUTPUT_FOLDER, '{}_report.json'.format(basefilename))
- with open(filename, 'w') as file_handler:
116
- for item in results:
117
- file_handler.write("{}\n".format(item))
+ with open(filename, 'w', encoding='utf-8') as file_handler:
+ compact = results.to_json(orient='records')
118
+ readable = json.dumps(json.loads(compact), indent=2)
119
+ file_handler.write(readable)
120
121
122
#print('Report in by intent structure')
0 commit comments