Skip to content

Commit 73ca08d

Browse files
authored
Merge pull request #352 from Labelbox/issue350
update to remove the check on if it is a list
2 parents b255334 + f7b1444 commit 73ca08d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

labelbox/schema/dataset.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import ndjson
1010
from io import StringIO
1111
import requests
12+
from collections.abc import Iterable
1213

1314
from labelbox.exceptions import InvalidQueryError, LabelboxError, ResourceNotFoundError, InvalidAttributeError
1415
from labelbox.orm.db_object import DbObject, Updateable, Deletable
@@ -298,9 +299,10 @@ def convert_item(item):
298299
for key, value in item.items()
299300
}
300301

301-
if not isinstance(items, list):
302+
if not isinstance(items, Iterable):
302303
raise ValueError(
303-
f"Must pass a list to create_data_rows. Found {type(items)}")
304+
f"Must pass an iterable to create_data_rows. Found {type(items)}"
305+
)
304306

305307
with ThreadPoolExecutor(file_upload_thread_count) as executor:
306308
futures = [executor.submit(convert_item, item) for item in items]

0 commit comments

Comments
 (0)