Skip to content

Commit 6d6e067

Browse files
committed
Garbage collect & Rename experiment Python API extensions. Not provided in the MLflow python API, but available through the MLflow CLI
1 parent 24fe5bd commit 6d6e067

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

dataikuapi/dss/mlflow.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,28 @@ def list_experiments(self):
3535
headers={"x-dku-mlflow-project-key": self.project_key}
3636
)
3737
return response.json()
38+
39+
def rename_experiment(self, experiment_id, new_name):
40+
"""
41+
Renames an experiment
42+
43+
:param experiment_id: experiment id
44+
:type experiment_id: str
45+
:param new_name: new name
46+
:type new_name: str
47+
"""
48+
response = self.client._perform_http(
49+
"POST", "/api/2.0/mlflow/experiments/update",
50+
headers={"x-dku-mlflow-project-key": self.project_key},
51+
body={"experiment_id": experiment_id, "new_name": new_name}
52+
)
53+
return response.json()
54+
55+
def garbage_collect(self):
56+
"""
57+
Permanently deletes the experiments and runs marked as "Deleted
58+
"""
59+
self.client._perform_http(
60+
"GET", "/api/2.0/mlflow/extension/garbage-collect",
61+
headers={"x-dku-mlflow-project-key": self.project_key}
62+
)

0 commit comments

Comments
 (0)