@@ -110,9 +110,11 @@ def configured_project(client, ontology, rand_gen):
110110 client .get_labeling_frontends (
111111 where = LabelingFrontend .name == "editor" ))[0 ]
112112 project .setup (editor , ontology )
113+ data_row_ids = []
113114 for _ in range (len (ontology ['tools' ]) + len (ontology ['classifications' ])):
114- dataset .create_data_row (row_data = IMG_URL )
115+ data_row_ids . append ( dataset .create_data_row (row_data = IMG_URL ). uid )
115116 project .datasets .connect (dataset )
117+ project .data_row_ids = data_row_ids
116118 yield project
117119 project .delete ()
118120 dataset .delete ()
@@ -122,7 +124,6 @@ def configured_project(client, ontology, rand_gen):
122124def prediction_id_mapping (configured_project ):
123125 #Maps tool types to feature schema ids
124126 ontology = configured_project .ontology ().normalized
125- datarows = [d for d in list (configured_project .datasets ())[0 ].data_rows ()]
126127 result = {}
127128
128129 for idx , tool in enumerate (ontology ['tools' ] + ontology ['classifications' ]):
@@ -134,7 +135,7 @@ def prediction_id_mapping(configured_project):
134135 "uuid" : str (uuid .uuid4 ()),
135136 "schemaId" : tool ['featureSchemaId' ],
136137 "dataRow" : {
137- "id" : datarows [idx ]. uid ,
138+ "id" : configured_project . data_row_ids [idx ],
138139 },
139140 'tool' : tool
140141 }
0 commit comments