Skip to content

Commit 0ab3743

Browse files
committed
[X-0] Fix create batch with data row classes
1 parent ae9c990 commit 0ab3743

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

labelbox/schema/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def create_batch(self,
606606
raise ValueError("You need at least one data row in a batch")
607607

608608
self._wait_until_data_rows_are_processed(
609-
data_rows, self._wait_processing_max_seconds)
609+
dr_ids, self._wait_processing_max_seconds)
610610
method = 'createBatchV2'
611611
query_str = """mutation %sPyApi($projectId: ID!, $batchInput: CreateBatchInput!) {
612612
project(where: {id: $projectId}) {

tests/integration/test_batch.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def test_create_batch(batch_project: Project, big_dataset: Dataset):
5656

5757

5858
def test_create_batch_with_consensus_settings(batch_project: Project,
59-
big_dataset: Dataset):
60-
data_rows = [dr.uid for dr in list(big_dataset.export_data_rows())]
59+
small_dataset: Dataset):
60+
data_rows = [dr.uid for dr in list(small_dataset.export_data_rows())]
6161
consensus_settings = {"coverage_percentage": 0.1, "number_of_labels": 3}
6262
batch = batch_project.create_batch("batch with consensus settings",
6363
data_rows,
@@ -68,6 +68,14 @@ def test_create_batch_with_consensus_settings(batch_project: Project,
6868
assert batch.consensus_settings == consensus_settings
6969

7070

71+
def test_create_batch_with_data_row_class(batch_project: Project,
72+
small_dataset: Dataset):
73+
data_rows = list(small_dataset.export_data_rows())
74+
batch = batch_project.create_batch("test-batch-data-rows", data_rows, 3)
75+
assert batch.name == "test-batch-data-rows"
76+
assert batch.size == len(data_rows)
77+
78+
7179
def test_archive_batch(batch_project: Project, small_dataset: Dataset):
7280
data_rows = [dr.uid for dr in list(small_dataset.export_data_rows())]
7381
batch = batch_project.create_batch("batch to archive", data_rows)

0 commit comments

Comments
 (0)