Skip to content

Commit 15fe307

Browse files
author
Kevin Kim
committed
Initial commit
1 parent 8f4a839 commit 15fe307

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

labelbox/orm/model.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ def __init__(self, enum_cls: type):
5454
def name(self):
5555
return self.enum_cls.__name__
5656

57+
class ListType:
58+
59+
def __init__(self, list_cls: type):
60+
self.list_cls = list_cls
61+
62+
@property
63+
def name(self):
64+
return self.list_cls.__name__
65+
5766
class Order(Enum):
5867
""" Type of sort ordering. """
5968
Asc = auto()
@@ -91,8 +100,12 @@ def Enum(enum_cls: type, *args):
91100
def Json(*args):
92101
return Field(Field.Type.Json, *args)
93102

103+
@staticmethod
104+
def List(list_cls: type, *args):
105+
return Field(Field.ListType(list_cls), *args)
106+
94107
def __init__(self,
95-
field_type: Union[Type, EnumType],
108+
field_type: Union[Type, EnumType, ListType],
96109
name,
97110
graphql_name=None):
98111
""" Field init.

labelbox/schema/data_row.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from labelbox.orm import query
66
from labelbox.orm.db_object import DbObject, Updateable, BulkDeletable
77
from labelbox.orm.model import Entity, Field, Relationship
8+
from labelbox.schema.data_row_metadata import DataRowMetadataField
89

910
if TYPE_CHECKING:
1011
from labelbox import AssetAttachment
@@ -34,6 +35,7 @@ class DataRow(DbObject, Updateable, BulkDeletable):
3435
updated_at = Field.DateTime("updated_at")
3536
created_at = Field.DateTime("created_at")
3637
media_attributes = Field.Json("media_attributes")
38+
metadata_fields = Field.List(DataRowMetadataField, "metadata_fields")
3739

3840
# Relationships
3941
dataset = Relationship.ToOne("Dataset")

labelbox/schema/dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def convert_item(item):
314314
items = [future.result() for future in as_completed(futures)]
315315
# Prepare and upload the desciptor file
316316
data = json.dumps(items)
317+
print(f"!! input data: {data}")
317318
return self.client.upload_data(data)
318319

319320
def data_rows_for_external_id(self,

0 commit comments

Comments
 (0)