Skip to content

Commit 94503bb

Browse files
author
Val Brodsky
committed
Automatically add global key to data rows created in configured_project
1 parent f776b79 commit 94503bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/integration/annotation_import/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,12 @@ def configured_project(client, initial_dataset, ontology, rand_gen, image_url):
508508

509509
data_row_ids = []
510510

511-
for _ in range(len(ontology['tools']) + len(ontology['classifications'])):
512-
data_row_ids.append(dataset.create_data_row(row_data=image_url).uid)
511+
ontologies = ontology['tools'] + ontology['classifications']
512+
for ind in range(len(ontologies)):
513+
data_row_ids.append(
514+
dataset.create_data_row(
515+
row_data=image_url,
516+
global_key=f"gk_{ontologies[ind]['name']}_{rand_gen(str)}").uid)
513517
project._wait_until_data_rows_are_processed(data_row_ids=data_row_ids,
514518
sleep_interval=3)
515519

0 commit comments

Comments
 (0)