Skip to content

Commit b175d35

Browse files
authored
Merge pull request #717 from Labelbox/mkozik/catalog-to-batches
[QQC-506] Rename CATALOG to BATCH in QueueMode
2 parents 8efb3d9 + aa5fb80 commit b175d35

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
# Version 0.0.0 (YYYY-MM-DD) - In Progress
4+
5+
### Changed
6+
* Update QueueMode enum to support new value for QueueMode.Batch = `BATCH`.
7+
38
# Version 3.27.2 (2022-10-04)
49

510
### Added

labelbox/schema/queue_mode.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22

33

44
class QueueMode(str, Enum):
5-
Batch = "CATALOG"
5+
Batch = "BATCH"
66
Dataset = "DATA_SET"
7+
8+
@classmethod
9+
def _missing_(cls, value):
10+
# Parses the deprecated "CATALOG" value back to QueueMode.Batch.
11+
if value == "CATALOG":
12+
return QueueMode.Batch

tests/unit/test_queue_mode.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pytest
2+
3+
from labelbox.schema.queue_mode import QueueMode
4+
5+
6+
def test_parse_deprecated_catalog():
7+
assert QueueMode("CATALOG") == QueueMode.Batch
8+
9+
10+
def test_parse_batch():
11+
assert QueueMode("BATCH") == QueueMode.Batch
12+
13+
14+
def test_parse_data_set():
15+
assert QueueMode("DATA_SET") == QueueMode.Dataset
16+
17+
18+
def test_fails_for_unknown():
19+
with pytest.raises(ValueError):
20+
QueueMode("foo")

0 commit comments

Comments
 (0)