@@ -110,9 +110,11 @@ def configured_project(client, ontology, rand_gen):
110
110
client .get_labeling_frontends (
111
111
where = LabelingFrontend .name == "editor" ))[0 ]
112
112
project .setup (editor , ontology )
113
+ data_row_ids = []
113
114
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 )
115
116
project .datasets .connect (dataset )
117
+ project .data_row_ids = data_row_ids
116
118
yield project
117
119
project .delete ()
118
120
dataset .delete ()
@@ -122,7 +124,6 @@ def configured_project(client, ontology, rand_gen):
122
124
def prediction_id_mapping (configured_project ):
123
125
#Maps tool types to feature schema ids
124
126
ontology = configured_project .ontology ().normalized
125
- datarows = [d for d in list (configured_project .datasets ())[0 ].data_rows ()]
126
127
result = {}
127
128
128
129
for idx , tool in enumerate (ontology ['tools' ] + ontology ['classifications' ]):
@@ -134,7 +135,7 @@ def prediction_id_mapping(configured_project):
134
135
"uuid" : str (uuid .uuid4 ()),
135
136
"schemaId" : tool ['featureSchemaId' ],
136
137
"dataRow" : {
137
- "id" : datarows [idx ]. uid ,
138
+ "id" : configured_project . data_row_ids [idx ],
138
139
},
139
140
'tool' : tool
140
141
}
0 commit comments