Skip to content

Commit c6995a9

Browse files
Fix Dataset.create_data_rows error handling and docs.
1 parent 80d2554 commit c6995a9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

labelbox/schema/dataset.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,10 @@ def create_data_rows(self, items):
6969
7070
Raise:
7171
InvalidQueryError: if the `items` parameter does not conform to
72-
the specification above.
73-
MalformedRequestError: if the server did not accept the DataRow
74-
creation request.
75-
ResourceNotFoundError: if unable to retrieve the Task based on the
76-
task_id of the import process. This could imply that the import
77-
failed.
72+
the specification above or if the server did not accept the
73+
DataRow creation request (unknown reason).
74+
ResourceNotFoundError: if unable to retrieve the Task for the
75+
import process. This could imply that the import failed.
7876
InvalidAttributeError: if there are fields in `items` not valid for
7977
a DataRow.
8078
"""
@@ -128,8 +126,8 @@ def convert_item(item):
128126
query_str, {dataset_param: self.uid, url_param: descriptor_url})
129127
res = res["appendRowsToDataset"]
130128
if not res["accepted"]:
131-
raise MalformedRequestError(
132-
"Server did not accept DataRow creation request", data)
129+
raise InvalidQueryError(
130+
"Server did not accept DataRow creation request")
133131

134132
# Fetch and return the task.
135133
task_id = res["taskId"]

0 commit comments

Comments
 (0)