Skip to content

Commit 6e4e1d3

Browse files
Merge pull request #586 from Labelbox/kkim/add-datarow-limit
[AL-0] Limit create_data_rows() to 30k if datarows contain metadata
2 parents 13a6bf1 + f7805bc commit 6e4e1d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

labelbox/schema/dataset.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,16 @@ def convert_item(item):
342342
f"Must pass an iterable to create_data_rows. Found {type(items)}"
343343
)
344344

345+
# TODO: If any datarows contain metadata, we're limiting max # of datarows
346+
# until we address performance issues with datarow create with metadata
347+
max_datarow_with_metadata = 30_000
348+
if (len(items) > max_datarow_with_metadata):
349+
for row in items:
350+
if 'metadata_fields' in row:
351+
raise ValueError(
352+
f"Cannot create more than {max_datarow_with_metadata} DataRows, if any DataRows contain metadata"
353+
)
354+
345355
with ThreadPoolExecutor(file_upload_thread_count) as executor:
346356
futures = [executor.submit(convert_item, item) for item in items]
347357
items = [future.result() for future in as_completed(futures)]

0 commit comments

Comments
 (0)