Skip to content

Commit d4fc695

Browse files
author
Val Brodsky
committed
Remove 150K data rows limitation
1 parent 986078a commit d4fc695

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

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

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ def create_data_rows_sync(self, items) -> None:
260260
url_param: descriptor_url
261261
})
262262

263-
def create_data_rows(
264-
self,
265-
items,
266-
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT) -> "Task":
263+
def create_data_rows(self,
264+
items,
265+
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT
266+
) -> "DataUpsertTask":
267267
""" Asynchronously bulk upload data rows
268268
269269
Use this instead of `Dataset.create_data_rows_sync` uploads for batches that contain more than 1000 data rows.
@@ -576,10 +576,10 @@ def _export(
576576
is_streamable = res["isStreamable"]
577577
return Task.get_task(self.client, task_id), is_streamable
578578

579-
def upsert_data_rows(
580-
self,
581-
items,
582-
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT) -> "Task":
579+
def upsert_data_rows(self,
580+
items,
581+
file_upload_thread_count=FILE_UPLOAD_THREAD_COUNT
582+
) -> "DataUpsertTask":
583583
"""
584584
Upserts data rows in this dataset. When "key" is provided, and it references an existing data row,
585585
an update will be performed. When "key" is not provided a new data row will be created.
@@ -610,18 +610,14 @@ def upsert_data_rows(
610610
>>> ])
611611
>>> task.wait_till_done()
612612
"""
613-
if len(items) > MAX_DATAROW_PER_API_OPERATION:
614-
raise MalformedQueryException(
615-
f"Cannot upsert more than {MAX_DATAROW_PER_API_OPERATION} DataRows per function call."
616-
)
617-
618613
specs = DataRowUpsertItem.build(self.uid, items)
619614
return self._exec_upsert_data_rows(specs, file_upload_thread_count)
620615

621616
def _exec_upsert_data_rows(
622-
self,
623-
specs: List[DataRowItemBase],
624-
file_upload_thread_count: int = FILE_UPLOAD_THREAD_COUNT) -> "Task":
617+
self,
618+
specs: List[DataRowItemBase],
619+
file_upload_thread_count: int = FILE_UPLOAD_THREAD_COUNT
620+
) -> "DataUpsertTask":
625621

626622
manifest = DataRowUploader.upload_in_chunks(
627623
client=self.client,

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)