diff --git a/sdk/python/kfp/client/client.py b/sdk/python/kfp/client/client.py index 0f787ce93fd..4ca3a6f7e97 100644 --- a/sdk/python/kfp/client/client.py +++ b/sdk/python/kfp/client/client.py @@ -353,7 +353,7 @@ def _get_config_with_default_credentials(self, config): config.refresh_api_key_hook(config) return config - def set_user_namespace(self, namespace: str): + def set_user_namespace(self, namespace: str) -> None: """Set user namespace into local context setting file. This function should only be used when Kubeflow Pipelines is in the @@ -361,6 +361,9 @@ def set_user_namespace(self, namespace: str): Args: namespace: kubernetes namespace the user has access to. + + Returns: + None """ self._context_setting['namespace'] = namespace if not os.path.exists(os.path.dirname(Client.LOCAL_KFP_CONTEXT)): @@ -590,6 +593,9 @@ def archive_experiment(self, experiment_id: str) -> None: Args: experiment_id: id of the experiment. + + Returns: + None """ self._experiment_api.archive_experiment(id=experiment_id) @@ -598,10 +604,13 @@ def unarchive_experiment(self, experiment_id: str) -> None: Args: experiment_id: id of the experiment. + + Returns: + None """ self._experiment_api.unarchive_experiment(id=experiment_id) - def delete_experiment(self, experiment_id): + def delete_experiment(self, experiment_id: str): """Delete experiment. Args: @@ -765,6 +774,39 @@ def run_pipeline( IPython.display.display(IPython.display.HTML(html)) return response.run + def archive_run(self, run_id: str) -> None: + """Archives a run. + + Args: + run_id: id of the run. + + Returns: + None + """ + self._run_api.archive_run(id=run_id) + + def unarchive_run(self, run_id: str) -> None: + """Restores an archived run. + + Args: + run_id: id of the run. + + Returns: + None + """ + self._run_api.unarchive_run(id=run_id) + + def delete_run(self, run_id: str): + """Deletes a run. + + Args: + run_id: id of the run. + + Returns: + Object. + """ + return self._run_api.delete_run(id=run_id) + def create_recurring_run( self, experiment_id: str, @@ -1098,8 +1140,7 @@ def delete_job(self, job_id: str): job_id: id of the job. Returns: - Object. If the method is called asynchronously, returns the request - thread. + Object. Raises: kfp_server_api.ApiException: If the job is not found. @@ -1113,8 +1154,7 @@ def disable_job(self, job_id: str): job_id: id of the job. Returns: - Object. If the method is called asynchronously, returns the request - thread. + Object. Raises: kfp_server_api.ApiException: If the job is not found. @@ -1125,11 +1165,10 @@ def enable_job(self, job_id: str): """Enables a job. Args: - job_id: id of the job. + job_id: id of the job. Returns: - Object. If the method is called asynchronously, returns the request - thread. + Object. Raises: kfp_server_api.ApiException: If the job is not found. @@ -1436,8 +1475,7 @@ def delete_pipeline(self, pipeline_id): pipeline_id: id of the pipeline. Returns: - Object. If the method is called asynchronously, returns the request - thread. + Object. Raises: kfp_server_api.ApiException: If pipeline is not found. @@ -1515,8 +1553,7 @@ def delete_pipeline_version(self, version_id: str): version_id: id of the pipeline version. Returns: - Object. If the method is called asynchronously, returns the request - thread. + Object. Raises: kfp_server_api.ApiException: If pipeline is not found.