Skip to content

Commit bff8a07

Browse files
authored
Merge pull request #465 from Labelbox/jt/dropdowndoc
[AL-1688] Dropdown Deprecation Changelog Update
2 parents 5bfae7e + eb00c4a commit bff8a07

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Changelog
2+
# Version X.XX.X (2022-03-XX)
3+
## Updated
4+
* Deprecation: Creating Dropdowns will no longer be supported after 2022-03-31
5+
- This includes creating/adding Dropdowns to an ontology
6+
- This includes creating/adding Dropdown Annotation Type
7+
- For the same functionality, use Radio
8+
- This will not affect existing Dropdowns
9+
110
# Changelog
211
# Version 3.15.0 (2022-02-28)
312
## Added

labelbox/data/annotation_types/classification/classification.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Any, Dict, List, Union, Optional
2+
import warnings
23

34
try:
45
from typing import Literal
@@ -72,6 +73,15 @@ class Dropdown(_TempName):
7273
"""
7374
- A classification with many selected options allowed .
7475
- This is not currently compatible with MAL.
76+
77+
Deprecation Notice: Dropdown classification is deprecated and will be
78+
removed in a future release. Dropdown will also
79+
no longer be able to be created in the Editor on 3/31/2022.
7580
"""
7681
name: Literal["dropdown"] = "dropdown"
7782
answer: List[ClassificationAnswer]
83+
84+
def __init__(self, **data: Any):
85+
warnings.warn("Dropdown classification is deprecated and will be "
86+
"removed in a future release")
87+
super().__init__(**data)

labelbox/schema/ontology.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from dataclasses import dataclass, field
55
from enum import Enum
66
from typing import Any, Dict, List, Optional, Union, Type
7+
import warnings
78

89
from pydantic import constr
910

@@ -82,6 +83,11 @@ def add_option(self, option: 'Classification') -> None:
8283
@dataclass
8384
class Classification:
8485
"""
86+
87+
Deprecation Notice: Dropdown classification is deprecated and will be
88+
removed in a future release. Dropdown will also
89+
no longer be able to be created in the Editor on 3/31/2022.
90+
8591
A classfication to be added to a Project's ontology. The
8692
classification is dependent on the Classification Type.
8793
@@ -127,6 +133,13 @@ class Type(Enum):
127133
schema_id: Optional[str] = None
128134
feature_schema_id: Optional[str] = None
129135

136+
def __post_init__(self):
137+
if self.class_type == Classification.Type.DROPDOWN:
138+
warnings.warn(
139+
"Dropdown classification is deprecated and will be "
140+
"removed in a future release. Dropdown will also "
141+
"no longer be able to be created in the Editor on 3/31/2022.")
142+
130143
@property
131144
def name(self) -> str:
132145
return self.instructions

0 commit comments

Comments
 (0)