Skip to content

Commit d51e6ef

Browse files
committed
nit changes
1 parent 79b7a71 commit d51e6ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

labelbox/schema/dataset.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,20 +395,20 @@ def convert_item(item):
395395
f"Must pass an iterable to create_data_rows. Found {type(items)}"
396396
)
397397

398+
if len(items) > MAX_DATAROW_PER_API_OPERATION:
399+
raise MalformedQueryException(
400+
f"Cannot create more than {MAX_DATAROW_PER_API_OPERATION} DataRows per function call."
401+
)
402+
398403
# TODO: If any datarows contain metadata, we're limiting max # of datarows
399404
# until we address performance issues with datarow create with metadata
400-
if (len(items) > MAX_DATAROW_WITH_METADATA):
405+
if len(items) > MAX_DATAROW_WITH_METADATA:
401406
for row in items:
402407
if 'metadata_fields' in row:
403408
raise MalformedQueryException(
404409
f"Cannot create more than {MAX_DATAROW_WITH_METADATA} DataRows, if any DataRows contain metadata"
405410
)
406411

407-
if len(items) > MAX_DATAROW_PER_API_OPERATION:
408-
raise MalformedQueryException(
409-
f"Cannot create more than {MAX_DATAROW_PER_API_OPERATION} DataRows per function call."
410-
)
411-
412412
with ThreadPoolExecutor(file_upload_thread_count) as executor:
413413
futures = [executor.submit(convert_item, item) for item in items]
414414
items = [future.result() for future in as_completed(futures)]

0 commit comments

Comments
 (0)