From 74674a0ed37642497c117f2b29e94cc8a049af3b Mon Sep 17 00:00:00 2001 From: Pierre Bailly-Ferry Date: Tue, 30 Mar 2021 11:14:24 +0200 Subject: [PATCH 1/2] Deleting unecessary API --- dataikuapi/dssclient.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/dataikuapi/dssclient.py b/dataikuapi/dssclient.py index d52f2294..d53708d6 100644 --- a/dataikuapi/dssclient.py +++ b/dataikuapi/dssclient.py @@ -94,28 +94,6 @@ def get_future(self, job_id): # Notebooks ######################################################## - - def list_jupyter_notebooks(self, active=False, as_objects=True): - """ - List the Jupyter notebooks for every projects - - :param boolean active: if True, only the active notebooks - :param boolean as_objects: if True, each returned item will be a :class:`dataikuapi.dss.notebook.DSSJupyterNotebook` - - :return: list of notebooks. if as_objects is True, each entry in the list is a :class:`dataikuapi.dss.notebook.DSSJupyterNotebook`. Else, each item in the list is a dict which contains at least a "name" field. - :rtype: list of :class:`dataikuapi.dss.notebook.DSSJupyterNotebook` or list of dict - """ - project_keys = self.list_project_keys() - output = [] - for project_key in project_keys: - notebook_names = self._perform_json("GET", "/projects/%s/jupyter-notebooks/" % project_key, params={"active": active}) - if as_objects: - output += [DSSJupyterNotebook(self, project_key, notebook_name) for notebook_name in notebook_names] - else: - for notebook_name in notebook_names: - output.append({u"projectKey": project_key, u"name": notebook_name}) - return output - def list_running_notebooks(self, as_objects=True): """ Deprecated. Use :meth:`DSSClient.list_jupyter_notebooks` From d39e39ff109bdba308322b72498b3c047bfe5ccd Mon Sep 17 00:00:00 2001 From: Arnaud PICHERY Date: Tue, 30 Mar 2021 23:21:52 +0200 Subject: [PATCH 2/2] Remove deprecated warning from list_active_notebooks --- dataikuapi/dssclient.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/dataikuapi/dssclient.py b/dataikuapi/dssclient.py index d53708d6..b6fa83c2 100644 --- a/dataikuapi/dssclient.py +++ b/dataikuapi/dssclient.py @@ -96,7 +96,6 @@ def get_future(self, job_id): def list_running_notebooks(self, as_objects=True): """ - Deprecated. Use :meth:`DSSClient.list_jupyter_notebooks` List the currently-running Jupyter notebooks :param boolean as_objects: if True, each returned item will be a :class:`dataikuapi.dss.notebook.DSSNotebook` @@ -104,7 +103,6 @@ def list_running_notebooks(self, as_objects=True): :return: list of notebooks. if as_objects is True, each entry in the list is a :class:`dataikuapi.dss.notebook.DSSNotebook`. Else, each item in the list is a dict which contains at least a "name" field. :rtype: list of :class:`dataikuapi.dss.notebook.DSSNotebook` or list of dict """ - warnings.warn("Use DSSClient.list_jupyter_notebooks", DeprecationWarning) notebook_list = self._perform_json("GET", "/admin/notebooks/") if as_objects: return [DSSNotebook(self, notebook['projectKey'], notebook['name'], notebook) for notebook in notebook_list]