Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# Version 0.0.0 (YYYY-MM-DD) - In Progress

### Changed
* Update QueueMode enum to support new value for QueueMode.Batch = `BATCH`.

# Version 3.27.2 (2022-10-04)

### Added
Expand Down
8 changes: 7 additions & 1 deletion labelbox/schema/queue_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@


class QueueMode(str, Enum):
Batch = "CATALOG"
Batch = "BATCH"
Dataset = "DATA_SET"

@classmethod
def _missing_(cls, value):
# Parses the deprecated "CATALOG" value back to QueueMode.Batch.
if value == "CATALOG":
return QueueMode.Batch
20 changes: 20 additions & 0 deletions tests/unit/test_queue_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pytest

from labelbox.schema.queue_mode import QueueMode


def test_parse_deprecated_catalog():
assert QueueMode("CATALOG") == QueueMode.Batch


def test_parse_batch():
assert QueueMode("BATCH") == QueueMode.Batch


def test_parse_data_set():
assert QueueMode("DATA_SET") == QueueMode.Dataset


def test_fails_for_unknown():
with pytest.raises(ValueError):
QueueMode("foo")