Skip to content

Commit b8908df

Browse files
committed
adding some missing doc strings and job output examples
1 parent 52afc59 commit b8908df

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

dataikuapi/dss/project.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ def publish_bundle(self, bundle_id, published_project_key=None):
10921092

10931093
def list_imported_bundles(self):
10941094
"""
1095-
Returns a list of imported bundles for a project.
1095+
:returns: a dict of bundles objects for the project.
10961096
"""
10971097
return self.client._perform_json("GET",
10981098
"/projects/%s/bundles/imported" % self.project_key)
@@ -1101,7 +1101,7 @@ def import_bundle_from_archive(self, archive_path):
11011101
"""
11021102
Imports a bundle from a path to a zip bundle archive.
11031103
1104-
:param archive_path: A full path to a zip archive, for example `/home/dataiku/DKU_HAIKU_STARTER_v1.zip`
1104+
:param str archive_path: A full path to a zip archive, for example `/home/dataiku/my-bundle-v1.zip`
11051105
"""
11061106
return self.client._perform_json("POST",
11071107
"/projects/%s/bundles/imported/actions/importFromArchive" % (self.project_key),
@@ -1111,11 +1111,13 @@ def import_bundle_from_stream(self, fp):
11111111
"""
11121112
Imports a bundle from a file stream
11131113
1114-
:param fp: pointer to a file stream For example:
1114+
:param file-like fp: file handler. Usage example:
11151115
1116-
```
1117-
with open()
1118-
```
1116+
.. code-block:: python
1117+
1118+
project = client.get_project('MY_PROJECT')
1119+
with open('/home/dataiku/my-bundle-v1.zip', 'rb') as f:
1120+
project.import_bundle_from_stream(f)
11191121
"""
11201122
files = {'file': fp}
11211123
return self.client._perform_empty("POST",
@@ -1138,9 +1140,6 @@ def activate_bundle(self, bundle_id, scenarios_to_enable=None):
11381140
"/projects/%s/bundles/imported/%s/actions/activate" % (self.project_key, bundle_id), body=options)
11391141

11401142
def preload_bundle(self, bundle_id):
1141-
"""
1142-
Preloads a bundle
1143-
"""
11441143
return self.client._perform_json("POST",
11451144
"/projects/%s/bundles/imported/%s/actions/preload" % (self.project_key, bundle_id))
11461145

0 commit comments

Comments
 (0)