Skip to content

Commit 0f515f6

Browse files
author
gdj0nes
committed
FIX: typing
1 parent 913834f commit 0f515f6

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

labelbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from labelbox.schema.dataset import Dataset
1010
from labelbox.schema.data_row import DataRow
1111
from labelbox.schema.label import Label
12-
from labelbox.schema.batch import Batch, BatchPriority
12+
from labelbox.schema.batch import Batch
1313
from labelbox.schema.review import Review
1414
from labelbox.schema.user import User
1515
from labelbox.schema.organization import Organization

labelbox/orm/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ class Entity(metaclass=EntityMeta):
347347
Invite: Type[labelbox.Invite]
348348
InviteLimit: Type[labelbox.InviteLimit]
349349
ProjectRole: Type[labelbox.ProjectRole]
350+
Batch: Type[labelbox.Batch]
350351

351352
@classmethod
352353
def _attributes_of_type(cls, attr_type):

labelbox/schema/batch.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
from typing import NewType
2-
31
from labelbox.orm.db_object import DbObject
42
from labelbox.orm.model import Field, Relationship
53

6-
BatchPriority = NewType('BatchPriority', int)
7-
84

95
class Batch(DbObject):
106
""" A Batch is a group of data rows submitted to a project for labeling
@@ -26,5 +22,4 @@ class Batch(DbObject):
2622

2723
# Relationships
2824
project = Relationship.ToOne("Project")
29-
3025
created_by = Relationship.ToOne("User")

labelbox/schema/project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ def setup(self, labeling_frontend, labeling_frontend_options) -> None:
571571

572572
def create_batch(self,
573573
name: str,
574-
data_rows: List[Union[str, "DataRow"]],
575-
priority: "BatchPriority" = 5):
574+
data_rows: List[str],
575+
priority: int = 5):
576576
"""Create a new batch for a project
577577
578578
Args:
@@ -588,8 +588,8 @@ def create_batch(self,
588588

589589
dr_ids = []
590590
for dr in data_rows:
591-
from labelbox import DataRow
592-
if isinstance(dr, DataRow):
591+
592+
if isinstance(dr, Entity.DataRow):
593593
dr_ids.append(dr.uid)
594594
elif isinstance(dr, str):
595595
dr_ids.append(dr)

0 commit comments

Comments
 (0)