Skip to content

Commit f09bef8

Browse files
committed
adding an example of closing file pointer for get_exported_bundle_archive_stream()
1 parent 3039d5b commit f09bef8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dataikuapi/dss/project.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,13 @@ def get_exported_bundle_archive_stream(self, bundle_id):
10551055
10561056
.. warning::
10571057
1058-
this stream will monopolize the DSSClient until closed.
1058+
this stream will monopolize the DSSClient until closed, so the stream must be closed after use or used within a ``with`` statement. For example:
1059+
1060+
.. code-block:: python
1061+
1062+
with project.get_exported_bundle_archive_stream('v1') as fp:
1063+
# use fp
1064+
10591065
"""
10601066
return self.client._perform_raw("GET",
10611067
"/projects/%s/bundles/exported/%s/archive" % (self.project_key, bundle_id))

0 commit comments

Comments
 (0)