Skip to content

Commit 6a1429d

Browse files
committed
turned identifiable to dataclasses
1 parent 49b418a commit 6a1429d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libs/labelbox/src/labelbox/schema/identifiable.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Union
33

44
from labelbox.schema.id_type import IdType
5+
from pydantic.dataclasses import dataclass
56

67

78
class Identifiable(ABC):
@@ -31,6 +32,7 @@ def __str__(self):
3132
return f"{self.id_type}:{self.key}"
3233

3334

35+
@dataclass
3436
class UniqueId(Identifiable):
3537
"""
3638
Represents a unique, internally generated id.
@@ -40,6 +42,7 @@ def __init__(self, key: str):
4042
super().__init__(key, IdType.DataRowId)
4143

4244

45+
@dataclass
4346
class GlobalKey(Identifiable):
4447
"""
4548
Represents a user generated id.

0 commit comments

Comments
 (0)