Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
### Added
* Added `get_by_name()` method to MetadataOntology object to access both custom and reserved metadata by name.

### Changed
* `Dataset.create_data_rows()` max limit of DataRows increased to 150,000

# Version 3.33.1 (2022-12-14)
### Fixed
* Fixed where batch creation limit was still limiting # of data rows. SDK should now support creating batches with up to 100k data rows
Expand Down
12 changes: 1 addition & 11 deletions labelbox/schema/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

logger = logging.getLogger(__name__)

MAX_DATAROW_PER_API_OPERATION = 150000
MAX_DATAROW_WITH_METADATA = 30000
MAX_DATAROW_PER_API_OPERATION = 150_000


class Dataset(DbObject, Updateable, Deletable):
Expand Down Expand Up @@ -426,15 +425,6 @@ def convert_item(item):
f"Cannot create more than {MAX_DATAROW_PER_API_OPERATION} DataRows per function call."
)

# TODO: If any datarows contain metadata, we're limiting max # of datarows
# until we address performance issues with datarow create with metadata
if len(items) > MAX_DATAROW_WITH_METADATA:
for row in items:
if 'metadata_fields' in row:
raise MalformedQueryException(
f"Cannot create more than {MAX_DATAROW_WITH_METADATA} DataRows, if any DataRows contain metadata"
)

with ThreadPoolExecutor(file_upload_thread_count) as executor:
futures = [executor.submit(convert_item, item) for item in items]
items = [future.result() for future in as_completed(futures)]
Expand Down