Skip to content

Commit 4203a46

Browse files
author
Adrian Chang
committed
Buffered stream code
1 parent 3f5b9a4 commit 4203a46

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

libs/labelbox/src/labelbox/schema/export_task.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,19 @@ def get_buffered_stream(
850850
self,
851851
stream_type: StreamType = StreamType.RESULT,
852852
) -> Stream:
853-
"""Returns the result of the task."""
853+
"""
854+
Returns the result of the task.
855+
856+
Args:
857+
stream_type (StreamType, optional): The type of stream to retrieve. Defaults to StreamType.RESULT.
858+
859+
Returns:
860+
Stream: The buffered stream object.
861+
862+
Raises:
863+
ExportTask.ExportTaskException: If the task has failed or is not ready yet.
864+
ValueError: If the task does not have the specified stream type.
865+
"""
854866
if self._task.status == "FAILED":
855867
raise ExportTask.ExportTaskException("Task failed")
856868
if self._task.status != "COMPLETE":
@@ -864,7 +876,7 @@ def get_buffered_stream(
864876
)
865877
return BufferedStream(
866878
_TaskContext(self._task.client, self._task.uid, stream_type,
867-
metadata_header),
879+
metadata_header),
868880
)
869881

870882
def get_stream(

0 commit comments

Comments
 (0)