Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate inherit_collection parmeter in duplicate() methods #331

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading