@@ -153,18 +153,28 @@ def create_data_rows_from_table(
153
153
skip_duplicates = skip_duplicates , divider = divider , verbose = verbose
154
154
)
155
155
156
+ # If performing actions that require data row IDs, we pull them here
157
+ if actions ["batch" ] or actions ["annotate" ] or actions ["prediction" ]:
158
+ global_key_to_data_row_id = uploader .create_global_key_to_data_row_id_dict (
159
+ client = self .lb_client , global_keys = list (upload_dict .keys ())
160
+ )
161
+
156
162
# Bath to project attempt using labelbase.uploader.batch_rows_to_project
157
163
if actions ["batch" ]:
158
164
batch_to_project_results = batch_rows_to_project (
159
- client = self .lb_client , upload_dict = upload_dict , priority = priority , verbose = verbose
165
+ client = self .lb_client , upload_dict = upload_dict ,
166
+ global_key_to_data_row_id = global_key_to_data_row_id ,
167
+ priority = priority , verbose = verbose
160
168
)
161
169
else :
162
170
batch_to_project_results = []
163
171
164
172
# Annotation upload attempt using labelbase.uploader.batch_upload_annotations
165
173
if actions ["annotate" ]:
166
174
annotation_upload_results = batch_upload_annotations (
167
- client = self .lb_client , upload_dict = upload_dict , how = actions ["annotate" ], verbose = verbose
175
+ client = self .lb_client , upload_dict = upload_dict ,
176
+ global_key_to_data_row_id = global_key_to_data_row_id ,
177
+ how = actions ["annotate" ], verbose = verbose
168
178
)
169
179
else :
170
180
annotation_upload_results = []
@@ -182,10 +192,11 @@ def create_data_rows_from_table(
182
192
# If data rows aren't in the model run yet, add them with labelbase.uploader.batch_add_data_rows_to_model_run
183
193
if not ground_truth_upload_results :
184
194
data_row_to_model_run_results = batch_add_data_rows_to_model_run (
185
- client = self .lb_client , upload_dict = upload_dict
195
+ client = self .lb_client , upload_dict = upload_dict
186
196
)
187
197
prediction_upload_results = batch_upload_predictions (
188
- client = self .lb_client , upload_dict = upload_dict
198
+ client = self .lb_client , upload_dict = upload_dict ,
199
+ global_key_to_data_row_id = global_key_to_data_row_id
189
200
)
190
201
else :
191
202
data_row_to_model_run_results = []
0 commit comments