File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -68,15 +68,21 @@ def go():
6868 # init buffer
6969 buff = io .BytesIO ()
7070
71- # retrieve output from sz into buff
71+ # Retrieve output from sz into buff
72+ # sz will export JSONL lines; we add the chars necessary to make
73+ # the output as a whole be a single JSON blob.
7274 try :
7375 export_handle = sz_eng .export_json_entity_report (EXPORT_FLAGS )
76+ buff .write ('[' .encode ('utf-8' ))
7477 while 1 :
7578 chunk = sz_eng .fetch_next (export_handle )
7679 if not chunk :
7780 break
7881 buff .write (chunk .encode ('utf-8' ))
82+ buff .write (',' .encode ('utf-8' ))
7983 sz_eng .close_export_report (export_handle )
84+ buff .seek (- 1 , os .SEEK_CUR ) # toss out last comma
85+ buff .write (']' .encode ('utf-8' ))
8086 except sz .SzError as err :
8187 print (err )
8288
@@ -114,11 +120,14 @@ def upload_test_file():
114120 print ("SUCCESSFUL" )
115121
116122def get_file ():
117- key = 'output-1757986924786 .json'
123+ key = 'output-1758036760013 .json'
118124 print ('Grabbing file...' )
119125 s3 = make_s3_client ()
120126 resp = s3 .download_file (S3_BUCKET , key , '/tmp/' + key )
121127 print (resp )
122128 print ('done grabbing file.' )
123129 #f = open('/tmp/'+key)
124130 #print(f.readlines())
131+
132+ #upload_test_file()
133+ #get_file()
You can’t perform that action at this time.
0 commit comments