From f1ee36191c0c1f10e7069f6ac6986eadac934928 Mon Sep 17 00:00:00 2001 From: ryansingman Date: Thu, 16 May 2024 19:14:35 -0700 Subject: [PATCH 1/3] add delete dataset method --- cleanlab_studio/studio/studio.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cleanlab_studio/studio/studio.py b/cleanlab_studio/studio/studio.py index 779cc300..e74bf244 100644 --- a/cleanlab_studio/studio/studio.py +++ b/cleanlab_studio/studio/studio.py @@ -113,6 +113,19 @@ def upload_dataset( schema_overrides=schema_overrides, ) + def delete_dataset( + self, + dataset_id: str, + ) -> None: + """Deletes a dataset from Cleanlab Studio. + + If the dataset is used in projects, the projects will be deleted as well. + """ + api.delete_dataset( + self._api_key, + dataset_id, + ) + def download_cleanlab_columns( self, cleanset_id: str, From f53bcfc72053a2b0f631719e2b65cea582c6c7fc Mon Sep 17 00:00:00 2001 From: ryansingman Date: Thu, 16 May 2024 19:16:21 -0700 Subject: [PATCH 2/3] add api method --- cleanlab_studio/internal/api/api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cleanlab_studio/internal/api/api.py b/cleanlab_studio/internal/api/api.py index 175949e3..73eab2c4 100644 --- a/cleanlab_studio/internal/api/api.py +++ b/cleanlab_studio/internal/api/api.py @@ -461,6 +461,12 @@ def get_cleanset_status(api_key: str, cleanset_id: str) -> JSONDict: return status +def delete_dataset(api_key: str, dataset_id: str) -> None: + check_uuid_well_formed(dataset_id, "dataset ID") + res = requests.delete(dataset_base_url + f"/{dataset_id}", headers=_construct_headers(api_key)) + handle_api_error(res) + + def delete_project(api_key: str, project_id: str) -> None: check_uuid_well_formed(project_id, "project ID") res = requests.delete(project_base_url + f"/{project_id}", headers=_construct_headers(api_key)) From c72d0e653c968ecbd9e55595ef26ed45f2c7bcc9 Mon Sep 17 00:00:00 2001 From: ryansingman Date: Thu, 16 May 2024 19:18:59 -0700 Subject: [PATCH 3/3] Bump version (v2.0.5) --- cleanlab_studio/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanlab_studio/version.py b/cleanlab_studio/version.py index 28dcdc3a..b2003686 100644 --- a/cleanlab_studio/version.py +++ b/cleanlab_studio/version.py @@ -1,7 +1,7 @@ # Note to developers: # Consider if backend's MIN_CLI_VERSION needs updating when pushing any changes to this file. -__version__ = "2.0.4" +__version__ = "2.0.5" SCHEMA_VERSION = "0.2.0" MIN_SCHEMA_VERSION = "0.1.0"