Skip to content

Commit 89a9b00

Browse files
author
Gareth
committed
Address pr comments
1 parent 8be9e0d commit 89a9b00

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

labelbox/schema/project.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
logger = logging.getLogger(__name__)
3737

38-
MAX_BATCH_SIZE = 1000
38+
MAX_QUEUE_BATCH_SIZE = 1000
3939

4040

4141
class QueueMode(enum.Enum):
@@ -467,8 +467,8 @@ def _post_batch(self, method, data_row_ids: List[str]):
467467
if self.queue_mode() != QueueMode.Batch:
468468
raise ValueError("Project must be in batch mode")
469469

470-
if len(data_row_ids) > MAX_BATCH_SIZE:
471-
raise ValueError(f"Batch exceeds max size of {MAX_BATCH_SIZE}, consider breaking it into parts")
470+
if len(data_row_ids) > MAX_QUEUE_BATCH_SIZE:
471+
raise ValueError(f"Batch exceeds max size of {MAX_QUEUE_BATCH_SIZE}, consider breaking it into parts")
472472

473473
query = """mutation %sPyApi($projectId: ID!, $dataRowIds: [ID!]!) {
474474
project(where: {id: $projectId}) {
@@ -512,11 +512,8 @@ def _update_queue_mode(self, mode: QueueMode) -> QueueMode:
512512
query_str = """mutation %s($projectId: ID!, $status: TagSetStatusInput!) {
513513
project(where: {id: $projectId}) {
514514
setTagSetStatus(input: {tagSetStatus: $status}) {
515-
id
516515
tagSetStatus
517-
__typename
518516
}
519-
__typename
520517
}
521518
}
522519
""" % "setTagSetStatusPyApi"
@@ -532,9 +529,7 @@ def queue_mode(self):
532529

533530
query_str = """query %s($projectId: ID!) {
534531
project(where: {id: $projectId}) {
535-
id
536532
tagSetStatus
537-
__typename
538533
}
539534
}
540535
""" % "GetTagSetStatusPyApi"

tests/data/annotation_types/geometry/test_rectangle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def test_rectangle():
1515
expected['coordinates'] = tuple([tuple([tuple(x) for x in points[0]])])
1616
assert rectangle.shapely.__geo_interface__ == expected
1717

18-
# raster = rectangle.draw(height=32, width=32)
19-
# assert (cv2.imread("tests/data/assets/rectangle.png") == raster).all()
18+
raster = rectangle.draw(height=32, width=32)
19+
assert (cv2.imread("tests/data/assets/rectangle.png") == raster).all()
2020

2121
xyhw = Rectangle.from_xyhw(0., 0, 10, 10)
2222
assert xyhw.start == Point(x=0, y=0.)

tests/integration/test_project.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,4 @@ def test_queued_data_row_export(configured_project):
111111
def test_queue_mode(configured_project: Project):
112112
assert configured_project.queue_mode() == QueueMode.Dataset
113113
configured_project.update(queue_mode=QueueMode.Batch)
114-
# TODO: understand why this fails
115114
assert configured_project.queue_mode() == QueueMode.Batch

0 commit comments

Comments
 (0)