Skip to content

Commit f41f3a5

Browse files
author
Dmitriy Apollonin
committed
better return type
1 parent 4c9570f commit f41f3a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

labelbox/schema/annotation_import.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _create_from_bytes(cls, client, variables, query_str, file_name,
143143

144144
@classmethod
145145
def _get_ndjson_from_objects(cls, objects: List[Dict[str, Any]],
146-
object_name: str) -> bytes:
146+
object_name: str) -> BinaryIO:
147147
if not isinstance(objects, list):
148148
raise TypeError(
149149
f"{object_name} must be in a form of list. Found {type(objects)}"
@@ -228,7 +228,7 @@ def create_from_objects(
228228
data = cls._get_ndjson_from_objects(predictions, 'annotations')
229229

230230
return cls._create_mea_import_from_bytes(client, model_run_id, name,
231-
data, len(data))
231+
data, len(str(data)))
232232

233233
@classmethod
234234
def create_from_url(cls, client: "labelbox.Client", model_run_id: str,
@@ -470,7 +470,7 @@ def create_from_objects(
470470
Corresponding confidence score values will be ignored.
471471
""")
472472
return cls._create_mal_import_from_bytes(client, project_id, name, data,
473-
len(data))
473+
len(str(data)))
474474

475475
@classmethod
476476
def create_from_url(cls, client: "labelbox.Client", project_id: str,
@@ -626,7 +626,7 @@ def create_from_objects(cls, client: "labelbox.Client", project_id: str,
626626
Corresponding confidence score values will be ignored.
627627
""")
628628
return cls._create_label_import_from_bytes(client, project_id, name,
629-
data, len(data))
629+
data, len(str(data)))
630630

631631
@classmethod
632632
def create_from_url(cls, client: "labelbox.Client", project_id: str,

0 commit comments

Comments
 (0)