@@ -67,11 +67,8 @@ def run_task(task, model, avoid_duplicate_runs=True):
6767
6868 # execute the run
6969 run = OpenMLRun (task_id = task .task_id , flow_id = None , dataset_id = dataset .dataset_id , model = model )
70- try :
71- run .data_content , run .trace_content , run .trace_attributes = _run_task_get_arffcontent (model , task , class_labels )
72- except PyOpenMLError as message :
73- run .error_message = str (message )
74- warnings .warn ("Run terminated with error: %s" % run .error_message )
70+ run .data_content , run .trace_content , run .trace_attributes = _run_task_get_arffcontent (model , task , class_labels )
71+
7572
7673 if flow_id == False :
7774 # means the flow did not exists. As we could run it, publish it now
@@ -342,9 +339,16 @@ def _create_run_from_xml(xml):
342339 dataset_id = int (run ['oml:input_data' ]['oml:dataset' ]['oml:did' ])
343340
344341 predictions_url = None
345- for file_dict in run ['oml:output_data' ]['oml:file' ]:
342+ if isinstance (run ['oml:output_data' ]['oml:file' ], dict ):
343+ # only one result.. probably due to an upload error
344+ file_dict = run ['oml:output_data' ]['oml:file' ]
346345 if file_dict ['oml:name' ] == 'predictions' :
347346 predictions_url = file_dict ['oml:url' ]
347+ else :
348+ # multiple files, the normal case
349+ for file_dict in run ['oml:output_data' ]['oml:file' ]:
350+ if file_dict ['oml:name' ] == 'predictions' :
351+ predictions_url = file_dict ['oml:url' ]
348352 if predictions_url is None :
349353 raise ValueError ('No URL to download predictions for run %d in run '
350354 'description XML' % run_id )
0 commit comments