Skip to content

Commit b831413

Browse files
committed
Merge remote-tracking branch 'origin/release/6.0'
2 parents a5683be + 3188ad3 commit b831413

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

dataikuapi/dss/dataset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,15 @@ def with_store_into(self, connection, type_option_id = None, format_option_id =
280280
self.creation_settings["specificSettings"]["formatOptionId"] = format_option_id
281281
return self
282282

283-
def with_copy_partitioning_from(self, dataset_ref):
283+
def with_copy_partitioning_from(self, dataset_ref, object_type='DATASET'):
284284
"""
285285
Sets the new managed dataset to use the same partitioning as an existing dataset_name
286286
287287
:param str dataset_ref: Name of the dataset to copy partitioning from
288288
:return: self
289289
"""
290-
self.creation_settings["partitioningOptionId"] = "copy:%s" % dataset_ref
290+
code = 'dataset' if object_type == 'DATASET' else 'folder'
291+
self.creation_settings["partitioningOptionId"] = "copy:%s:%s" % (code, dataset_ref)
291292
return self
292293

293294
def create(self):

dataikuapi/dss/recipe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def with_new_output(self, name, connection_id, typeOptionId=None, format_option_
329329
AVRO, ORC
330330
:param override_sql_schema: schema to force dataset, for SQL dataset. If left empty, will be autodetected
331331
:param str partitioning_option_id: to copy the partitioning schema of an existing dataset 'foo', pass a
332-
value of 'copy:foo'
332+
value of 'copy:dataset:foo'
333333
:param append: whether the recipe should append or overwrite the output when running
334334
(note: not available for all dataset types)
335335
:param str object_type: DATASET or MANAGED_FOLDER

dataikuapi/dss/wiki.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,16 @@ def upload_attachement(self, fp, filename):
237237

238238
self.client._perform_json("POST", "/projects/%s/wiki/%s/upload" % (self.project_key, dku_quote_fn(self.article_id)), files={"file":(clean_filename, fp)})
239239

240+
def get_uploaded_file(self, upload_id):
241+
""""
242+
Download the attachement of an article
243+
244+
:param str upload_id: The attachement upload id
245+
:returns: The requests.Response object
246+
:rtype: :class:`requests.Response`
247+
"""
248+
return self.client._perform_raw("GET", "/projects/%s/wiki/%s/uploads/%s" % (self.project_key, self.article_id, upload_id))
249+
240250
def delete(self):
241251
"""
242252
Delete the article

0 commit comments

Comments
 (0)