Skip to content

Commit 0b8d228

Browse files
authored
Merge pull request #184 from Labelbox/ms/docstring-update
docstring update
2 parents 3b70de3 + fc6fb8b commit 0b8d228

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

docs/source/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ Client
1414
:exclude-members: upload_data, upload_file
1515
:show-inheritance:
1616

17+
AssetAttachment
18+
--------------------------------------
19+
20+
.. automodule:: labelbox.schema.asset_attachment
21+
:members:
22+
:show-inheritance:
23+
1724
AssetMetadata
1825
--------------------------------------
1926

labelbox/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from labelbox.schema.task import Task
1414
from labelbox.schema.labeling_frontend import LabelingFrontend
1515
from labelbox.schema.asset_metadata import AssetMetadata
16+
from labelbox.schema.asset_attachment import AssetAttachment
1617
from labelbox.schema.webhook import Webhook
1718
from labelbox.schema.prediction import Prediction, PredictionModel
1819
from labelbox.schema.ontology import Ontology

labelbox/schema/asset_metadata.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88

99

1010
class AssetMetadata(DbObject):
11-
""" Asset metadata (AKA Attachments) provides extra context about an asset while labeling.
12-
13-
Attributes:
14-
meta_type (str): IMAGE, VIDEO, TEXT, or IMAGE_OVERLAY
15-
meta_value (str): URL to an external file or a string of text
11+
"""
12+
`AssetMetadata` is deprecated. Use `AssetAttachment` instead
1613
"""
1714

1815
def __init__(self, *args, **kwargs):

labelbox/schema/data_row.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class DataRow(DbObject, Updateable, BulkDeletable):
2323
created_by (Relationship): `ToOne` relationship to User
2424
organization (Relationship): `ToOne` relationship to Organization
2525
labels (Relationship): `ToMany` relationship to Label
26-
metadata (Relationship): `ToMany` relationship to AssetMetadata
26+
attachments (Relationship) `ToMany` relationship with AssetAttachment
27+
metadata (Relationship): This Relationship is Deprecated. Please use `DataRow.attachments()` instead
2728
predictions (Relationship): `ToMany` relationship to Prediction
2829
"""
2930
external_id = Field.String("external_id")
@@ -70,14 +71,15 @@ def __init__(self, *args, **kwargs):
7071
self.attachments.supports_sorting = False
7172

7273
def create_attachment(self, attachment_type, attachment_value):
73-
""" Attaches asset metadata to a DataRow.
74+
""" Adds an AssetAttachment to a DataRow.
75+
Labelers can view these attachments while labeling.
7476
7577
>>> datarow.create_attachment("TEXT", "This is a text message")
7678
7779
Args:
78-
meta_type (str): Asset attachment type, must be one of:
80+
attachment_type (str): Asset attachment type, must be one of:
7981
VIDEO, IMAGE, TEXT, IMAGE_OVERLAY (AssetAttachment.AttachmentType)
80-
meta_value (str): Asset attachment value.
82+
attachment_value (str): Asset attachment value.
8183
Returns:
8284
`AssetAttachment` DB object.
8385
Raises:

0 commit comments

Comments
 (0)