@@ -311,7 +311,7 @@ def submit(project_id, data_row_id):
311
311
})
312
312
features = feature_result ['project' ]['featuresForDataRow' ]
313
313
feature_ids = [feature ['id' ] for feature in features ]
314
- client .execute (
314
+ res = client .execute (
315
315
"""mutation createLabelPyApi ($project_id : ID!,$datarow_id: ID!,$feature_ids: [ID!]!,$time_seconds : Float!) {
316
316
createLabelFromFeatures(data: {dataRow: { id: $datarow_id },project: { id: $project_id },
317
317
featureIds: $feature_ids,secondsSpent: $time_seconds}) {id}}""" ,
@@ -321,6 +321,7 @@ def submit(project_id, data_row_id):
321
321
"feature_ids" : feature_ids ,
322
322
"time_seconds" : 10
323
323
})
324
+ return res ['createLabelFromFeatures' ]['id' ]
324
325
325
326
return submit
326
327
@@ -357,9 +358,8 @@ def configured_project_with_label(client, rand_gen, annotation_submit_fn,
357
358
upload_task = MALPredictionImport .create_from_objects (
358
359
client , project .uid , f'mal-import-{ uuid .uuid4 ()} ' , predictions )
359
360
upload_task .wait_until_done ()
360
- time .sleep (2 )
361
- annotation_submit_fn (project .uid , data_row .uid )
362
- time .sleep (2 )
363
- yield project
361
+ labels = annotation_submit_fn (project .uid , data_row .uid )
362
+ time .sleep (3 )
363
+ yield [project , labels ]
364
364
dataset .delete ()
365
365
project .delete ()
0 commit comments