Skip to content

Commit 55cec10

Browse files
author
Kevin Kim
committed
Modify comments and rid of graphql_type on metadata
1 parent ea34821 commit 55cec10

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

labelbox/schema/data_row.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ class DataRow(DbObject, Updateable, BulkDeletable):
2121
Otherwise, it's treated as an external URL.
2222
updated_at (datetime)
2323
created_at (datetime)
24-
media_attributes (dict): generated media attributes for the datarow
25-
metadata_fields (list): metadata associated with the datarow
24+
media_attributes (dict): generated media attributes for the data row
25+
metadata_fields (list): metadata associated with the data row
26+
metadata (list): metadata associated with the data row as list of DataRowMetadataField
2627
2728
dataset (Relationship): `ToOne` relationship to Dataset
2829
created_by (Relationship): `ToOne` relationship to User
@@ -41,7 +42,6 @@ class DataRow(DbObject, Updateable, BulkDeletable):
4142
name="metadata_fields",
4243
result_subquery="metadataFields { schemaId name value kind }")
4344
metadata = Field.List(DataRowMetadataField,
44-
graphql_type="DataRowCustomMetadataUpsertInput!",
4545
name="metadata",
4646
graphql_name="customMetadata",
4747
result_subquery="customMetadata { schemaId value }")

labelbox/schema/data_row_metadata.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,16 @@ def parse_metadata(
232232
def parse_metadata_fields(
233233
self, unparsed: List[Dict[str,
234234
Dict]]) -> List[DataRowMetadataField]:
235+
""" Parse metadata fields as list of `DataRowMetadataField`
236+
237+
>>> mdo.parse_metadata_fields([metadata_fields])
238+
239+
Args:
240+
unparsed: An unparsed list of metadata represented as a dict containing 'schemaId' and 'value'
241+
242+
Returns:
243+
metadata: List of `DataRowMetadataField`
244+
"""
235245
parsed = []
236246
if isinstance(unparsed, dict):
237247
raise ValueError("Pass a list of dictionaries")

0 commit comments

Comments
 (0)