From e71a3423d63dbf79a328f078b0eaf85c180a8b16 Mon Sep 17 00:00:00 2001 From: JureZmzrlikar Date: Wed, 8 Nov 2023 16:56:51 +0100 Subject: [PATCH] Deprecate inherit_collection parmeter in duplicate() methods --- docs/CHANGELOG.rst | 10 ++++++++++ src/resdk/resources/data.py | 9 ++------- src/resdk/resources/sample.py | 9 ++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 991700dc..6a5f51b5 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -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 =================== diff --git a/src/resdk/resources/data.py b/src/resdk/resources/data.py index 25080569..be70e8ba 100644 --- a/src/resdk/resources/data.py +++ b/src/resdk/resources/data.py @@ -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()) diff --git a/src/resdk/resources/sample.py b/src/resdk/resources/sample.py index 5fa31304..1dda36f5 100644 --- a/src/resdk/resources/sample.py +++ b/src/resdk/resources/sample.py @@ -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())