Skip to content

Commit 8be9e0d

Browse files
author
Gareth
authored
Update project.py
1 parent e5d196f commit 8be9e0d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

labelbox/schema/project.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -450,27 +450,25 @@ def setup(self, labeling_frontend, labeling_frontend_options):
450450
self.update(setup_complete=timestamp)
451451

452452
def queue(self, data_row_ids: List[str]):
453-
"""Add DataRows to the Project queue"""
454-
455-
if self.queue_mode() != QueueMode.Batch:
456-
raise ValueError("Project must be in batch mode")
453+
"""Add Data Rows to the Project queue"""
457454

458455
method = "submitBatchOfDataRows"
459456
return self._post_batch(method, data_row_ids)
460457

461458
def dequeue(self, data_row_ids: List[str]):
462-
463-
if self.queue_mode() != QueueMode.Batch:
464-
raise ValueError("Project must be in batch mode")
459+
"""Remove Data Rows from the Project queue"""
465460

466461
method = "removeBatchOfDataRows"
467462
return self._post_batch(method, data_row_ids)
468463

469464
def _post_batch(self, method, data_row_ids: List[str]):
470-
"""Create """
465+
"""Post batch methods"""
466+
467+
if self.queue_mode() != QueueMode.Batch:
468+
raise ValueError("Project must be in batch mode")
471469

472470
if len(data_row_ids) > MAX_BATCH_SIZE:
473-
raise ValueError(f"Exceed max batch size of {MAX_BATCH_SIZE}")
471+
raise ValueError(f"Batch exceeds max size of {MAX_BATCH_SIZE}, consider breaking it into parts")
474472

475473
query = """mutation %sPyApi($projectId: ID!, $dataRowIds: [ID!]!) {
476474
project(where: {id: $projectId}) {

0 commit comments

Comments
 (0)