Skip to content

Commit 51f33ae

Browse files
author
Val Brodsky
committed
Remove 150K data rows limitation
1 parent e0d458c commit 51f33ae

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

libs/labelbox/src/labelbox/schema/dataset.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ def create_data_rows_sync(self, items) -> None:
256256
url_param: descriptor_url
257257
})
258258

259-
def create_data_rows(
260-
self,
261-
items,
262-
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT) -> "Task":
259+
def create_data_rows(self,
260+
items,
261+
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT
262+
) -> "DataUpsertTask":
263263
""" Asynchronously bulk upload data rows
264264
265265
Use this instead of `Dataset.create_data_rows_sync` uploads for batches that contain more than 1000 data rows.
@@ -572,10 +572,10 @@ def _export(
572572
is_streamable = res["isStreamable"]
573573
return Task.get_task(self.client, task_id), is_streamable
574574

575-
def upsert_data_rows(
576-
self,
577-
items,
578-
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT) -> "Task":
575+
def upsert_data_rows(self,
576+
items,
577+
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT
578+
) -> "DataUpsertTask":
579579
"""
580580
Upserts data rows in this dataset. When "key" is provided, and it references an existing data row,
581581
an update will be performed. When "key" is not provided a new data row will be created.
@@ -606,11 +606,6 @@ def upsert_data_rows(
606606
>>> ])
607607
>>> task.wait_till_done()
608608
"""
609-
if len(items) > MAX_DATAROW_PER_API_OPERATION:
610-
raise MalformedQueryException(
611-
f"Cannot upsert more than {MAX_DATAROW_PER_API_OPERATION} DataRows per function call."
612-
)
613-
614609
specs = DataRowUpsertItem.build(self.uid, items)
615610
return self._exec_upsert_data_rows(specs, file_upload_thread_count)
616611

libs/labelbox/tests/data/annotation_import/test_model_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def test_model_run_split_assignment_by_data_row_ids(
174174
data_rows = dataset.create_data_rows([{
175175
"row_data": image_url
176176
} for _ in range(n_data_rows)])
177+
data_rows.wait_till_done()
177178
data_row_ids = [data_row['id'] for data_row in data_rows.result]
178179
configured_project_with_one_data_row._wait_until_data_rows_are_processed(
179180
data_row_ids=data_row_ids)

libs/labelbox/tests/integration/test_task.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ def test_task_success_json(dataset, image_url, snapshot):
5858
'test_task.test_task_success_json.json')
5959
assert len(task.result)
6060

61+
6162
@pytest.mark.export_v1("export_v1 test remove later")
6263
def test_task_success_label_export(client, configured_project_with_label):
6364
project, _, _, _ = configured_project_with_label
6465
# TODO: Move to export_v2
65-
res = project.export_labels()
66+
project.export_labels()
6667
user = client.get_user()
6768
task = None
6869
for task in user.created_tasks():

0 commit comments

Comments
 (0)