Skip to content

Commit

Permalink
Deprecate inherit_collection parmeter in duplicate() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JureZmrzlikar committed Nov 8, 2023
1 parent 28e17f7 commit e71a342
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 10 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ Change Log
All notable changes to this project are documented in this file.


==========
Unreleased
==========

Changed
-------
- **BACKWARD INCOMPATIBLE:** Remove ``inherit_collection`` parameter in
``Data.duplicate()`` and ``Sample.duplicate()``


===================
20.0.0 - 2023-10-27
===================
Expand Down
9 changes: 2 additions & 7 deletions src/resdk/resources/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,11 @@ def stdout(self):
return output.decode("utf-8")

@assert_object_exists
def duplicate(self, inherit_collection=False):
def duplicate(self):
"""Duplicate (make copy of) ``data`` object.
:param inherit_collection: If ``True`` then duplicated data
will be added to collection of the original data.
:return: Duplicated data object
"""
task_data = self.api().duplicate.post(
{"ids": [self.id], "inherit_collection": inherit_collection}
)
task_data = self.api().duplicate.post({"ids": [self.id]})
background_task = BackgroundTask(resolwe=self.resolwe, **task_data)
return self.resolwe.data.get(id__in=background_task.result())
9 changes: 2 additions & 7 deletions src/resdk/resources/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,12 @@ def is_background(self):
return self._is_background

@assert_object_exists
def duplicate(self, inherit_collection=False):
def duplicate(self):
"""Duplicate (make copy of) ``sample`` object.
:param inherit_collection: If ``True`` then duplicated samples
(and their data) will be added to collection of the original
sample.
:return: Duplicated sample
"""
task_data = self.api().duplicate.post(
{"ids": [self.id], "inherit_collection": inherit_collection}
)
task_data = self.api().duplicate.post({"ids": [self.id]})
background_task = BackgroundTask(resolwe=self.resolwe, **task_data)
return self.resolwe.sample.get(id__in=background_task.result())

Expand Down

0 comments on commit e71a342

Please sign in to comment.