Skip to content

Commit c6a8bec

Browse files
author
Matt Sokoloff
committed
yapf
1 parent 34495c6 commit c6a8bec

File tree

7 files changed

+197
-148
lines changed

7 files changed

+197
-148
lines changed

labelbox/schema/data_row.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class DataRow(DbObject, Updateable, BulkDeletable):
3333
labels = Relationship.ToMany("Label", True)
3434
metadata = Relationship.ToMany("AssetMetadata", False, "metadata")
3535
predictions = Relationship.ToMany("Prediction", False)
36-
3736

3837
@staticmethod
3938
def bulk_delete(data_rows):
@@ -62,7 +61,9 @@ def create_metadata(self, meta_type, meta_value):
6261
`AssetMetadata` DB object.
6362
"""
6463
if meta_type not in AssetMetadata.VALID_TYPES:
65-
raise ValueError(f"metadata type must be one of {AssetMetadata.VALID_TYPES}. Found {meta_type}")
64+
raise ValueError(
65+
f"metadata type must be one of {AssetMetadata.VALID_TYPES}. Found {meta_type}"
66+
)
6667

6768
meta_type_param = "metaType"
6869
meta_value_param = "metaValue"

labelbox/schema/dataset.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def convert_item(item):
164164
task._user = user
165165
return task
166166

167-
def data_rows_for_external_id(self, external_id, limit = 10):
167+
def data_rows_for_external_id(self, external_id, limit=10):
168168
""" Convenience method for getting a single `DataRow` belonging to this
169169
`Dataset` that has the given `external_id`.
170170
@@ -205,7 +205,10 @@ def data_row_for_external_id(self, external_id):
205205
in this `DataSet` with the given external ID, or if there are
206206
multiple `DataRows` for it.
207207
"""
208-
data_rows = self.data_rows_for_external_id(external_id=external_id, limit = 2)
208+
data_rows = self.data_rows_for_external_id(external_id=external_id,
209+
limit=2)
209210
if len(data_rows) > 1:
210-
logging.warn("More than one data_row has the provided external_id. Use function data_rows_for_external_id to fetch all")
211+
logging.warn(
212+
"More than one data_row has the provided external_id. Use function data_rows_for_external_id to fetch all"
213+
)
211214
return data_rows[0]

labelbox/schema/webhook.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
logger = logging.getLogger(__name__)
77

8+
89
class Webhook(DbObject, Updateable):
910
""" Represents a server-side rule for sending notifications to a web-server
1011
whenever one of several predefined actions happens within a context of
@@ -29,17 +30,13 @@ class Webhook(DbObject, Updateable):
2930
LABEL_UPDATED = "LABEL_UPDATED"
3031
LABEL_DELETED = "LABEL_DELETED"
3132

32-
REVIEW_CREATED ="REVIEW_CREATED"
33-
REVIEW_UPDATED ="REVIEW_UPDATED"
33+
REVIEW_CREATED = "REVIEW_CREATED"
34+
REVIEW_UPDATED = "REVIEW_UPDATED"
3435
REVIEW_DELETED = "REVIEW_DELETED"
3536

3637
SUPPORTED_TOPICS = {
37-
LABEL_CREATED,
38-
LABEL_UPDATED,
39-
LABEL_DELETED,
40-
REVIEW_CREATED,
41-
REVIEW_UPDATED,
42-
REVIEW_DELETED
38+
LABEL_CREATED, LABEL_UPDATED, LABEL_DELETED, REVIEW_CREATED,
39+
REVIEW_UPDATED, REVIEW_DELETED
4340
}
4441

4542
updated_at = Field.DateTime("updated_at")
@@ -86,7 +83,7 @@ def create(client, topics, url, secret, project):
8683
project = Relationship.ToOne("Project")
8784

8885
def delete(self):
89-
self.update(status = "INACTIVE")
86+
self.update(status="INACTIVE")
9087

9188
def update(self, topics=None, url=None, status=None):
9289
""" Updates this Webhook.

0 commit comments

Comments
 (0)