Skip to content

Commit 6b2af89

Browse files
author
Val Brodsky
committed
Restored LabelGenerator#as_list as per PR feedback
1 parent 3dafbd7 commit 6b2af89

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

labelbox/data/annotation_types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from .data import VideoData
2525

2626
from .label import Label
27+
from .collection import LabelList
2728
from .collection import LabelGenerator
2829

2930
from .metrics import ScalarMetric

labelbox/data/annotation_types/collection.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ class LabelList:
2222
Use on smaller datasets.
2323
"""
2424

25-
2625
def __init__(self, data: Optional[Iterable[Label]] = None):
2726
warnings.warn("LabelList is deprecated and will be "
28-
"removed in a future release.")
27+
"removed in a future release.")
2928

3029
if data is None:
3130
self._data = []
@@ -188,6 +187,12 @@ def __init__(self, data: Generator[Label, None, None], *args, **kwargs):
188187
self._fns = {}
189188
super().__init__(data, *args, **kwargs)
190189

190+
def as_list(self) -> "LabelList":
191+
warnings.warn("This method is deprecated and will be "
192+
"removed in a future release. LabelList"
193+
" class will be deprecated.")
194+
return LabelList(data=list(self))
195+
191196
def assign_feature_schema_ids(
192197
self,
193198
ontology_builder: "ontology.OntologyBuilder") -> "LabelGenerator":

0 commit comments

Comments
 (0)