Skip to content

Commit 54c2673

Browse files
committed
update for partitioningOptionId change
1 parent 3b01c7e commit 54c2673

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-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

0 commit comments

Comments
 (0)