Skip to content

Commit c364466

Browse files
committed
fix typos, imports
1 parent 039eda0 commit c364466

1 file changed

Lines changed: 48 additions & 66 deletions

File tree

dataikuapi/dss/projectfolder.py

Lines changed: 48 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
1-
import time
2-
from .dataset import DSSDataset
3-
from .recipe import DSSRecipe
4-
from .managedfolder import DSSManagedFolder
5-
from .savedmodel import DSSSavedModel
6-
from .job import DSSJob, DSSJobWaiter
7-
from .scenario import DSSScenario
8-
from .apiservice import DSSAPIService
9-
import sys
10-
import os.path as osp
11-
from .future import DSSFuture
12-
from .notebook import DSSNotebook
13-
from .macro import DSSMacro
14-
from .wiki import DSSWiki
15-
from .discussion import DSSObjectDiscussions
16-
from .ml import DSSMLTask
17-
from .analysis import DSSAnalysis
18-
from dataikuapi.utils import DataikuException
19-
1+
from .project import DSSProject
202

213
class DSSProjectFolder(object):
224
"""
@@ -32,7 +14,7 @@ def __init__(self, client, project_folder_id):
3214
# Project folder deletion
3315
########################################################
3416
def delete(self):
35-
"""
17+
"""
3618
Delete the project folder
3719
3820
This call requires an API key with admin rights
@@ -44,27 +26,27 @@ def delete(self):
4426
# Project folder settings
4527
########################################################
4628
def get_settings(self):
47-
"""
48-
:returns: A :class:`dataikuapi.dss.projectfolder.DSSProjectFolderSettings` to interact with this project folder settings
49-
"""
50-
settings = self.client._perform_json("GET", "/project-folders/%s/settings" % self.project_folder_id)
51-
return DSSProjectFolderSettings(self.client, self.project_folder_id, settings)
29+
"""
30+
:returns: A :class:`dataikuapi.dss.projectfolder.DSSProjectFolderSettings` to interact with this project folder settings
31+
"""
32+
settings = self.client._perform_json("GET", "/project-folders/%s/settings" % self.project_folder_id)
33+
return DSSProjectFolderSettings(self.client, self.project_folder_id, settings)
5234

53-
########################################################
35+
########################################################
5436
# Project folder sub-folder creation
5537
########################################################
5638
def create_sub_folder(self, name):
57-
"""
58-
Create a sub-folder into the current project folder
59-
60-
:param str name: the name of the project folder to create
61-
:returns: A :class:`dataikuapi.dss.projectfolder.DSSProjectFolder` to interact with the newly created project folder
62-
"""
63-
body = {
64-
"name": name
65-
}
66-
pf = self.client._perform_json("POST", "/project-folders/%s/children" % self.project_folder_id, body = body)
67-
return DSSProjectFolder(self.client, pf["id"])
39+
"""
40+
Create a sub-folder into the current project folder
41+
42+
:param str name: the name of the project folder to create
43+
:returns: A :class:`dataikuapi.dss.projectfolder.DSSProjectFolder` to interact with the newly created project folder
44+
"""
45+
body = {
46+
"name": name
47+
}
48+
pf = self.client._perform_json("POST", "/project-folders/%s/children" % self.project_folder_id, body = body)
49+
return DSSProjectFolder(self.client, pf["id"])
6850

6951
########################################################
7052
# Project creation
@@ -97,45 +79,45 @@ def create_project(self, project_key, name, owner, description=None, settings=No
9779
# Project folder move
9880
########################################################
9981
def move(self, destination):
100-
"""
101-
Move this project folder into another project folder (aka. destination)
82+
"""
83+
Move this project folder into another project folder (aka. destination)
10284
103-
:param destination: the project folder to put this project folder into
104-
:type destination: A :class:`dataikuapi.dss.projectfolders.DSSProjectFolder`
105-
"""
106-
body = {
107-
"destination": destination.project_folder_id
108-
}
109-
self.client._perform_json("POST", "/project-folders/%s/move" % self.project_folder_id, body = body)
85+
:param destination: the project folder to put this project folder into
86+
:type destination: A :class:`dataikuapi.dss.projectfolders.DSSProjectFolder`
87+
"""
88+
body = {
89+
"destination": destination.project_folder_id
90+
}
91+
self.client._perform_json("POST", "/project-folders/%s/move" % self.project_folder_id, body = body)
11092

11193
########################################################
11294
# Project move
11395
########################################################
11496
def project_move(self, project_key, destination):
115-
"""
116-
Move a project within this project folder into another project folder (aka. destination)
117-
118-
:param str project_key: the project key associated with the project to move
119-
:param destination: the project folder to put this project into
120-
:type destination: A :class:`dataikuapi.dss.projectfolders.DSSProjectFolder`
121-
"""
122-
body = {
123-
"destination": destination.project_folder_id
124-
}
125-
self.client._perform_json("POST", "/project-folders/%s/children/%s/move" % (self.project_folder_id, project_key), body = body)
97+
"""
98+
Move a project within this project folder into another project folder (aka. destination)
99+
100+
:param str project_key: the project key associated with the project to move
101+
:param destination: the project folder to put this project into
102+
:type destination: A :class:`dataikuapi.dss.projectfolders.DSSProjectFolder`
103+
"""
104+
body = {
105+
"destination": destination.project_folder_id
106+
}
107+
self.client._perform_json("POST", "/project-folders/%s/children/%s/move" % (self.project_folder_id, project_key), body = body)
126108

127109
class DSSProjectFolderSettings(object):
128-
"""
129-
A handle to interact with project folder settings
110+
"""
111+
A handle to interact with project folder settings
130112
131-
Do not create this class directly, instead use :meth:`dataikuapi.dss.projectfolder.DSSProjectFolder.get_settings`
132-
"""
133-
def __init__(self, client, project_folder_id, settings):
134-
self.client = client
135-
self.project_folder_id = project_folder_id
136-
self.settings = settings
113+
Do not create this class directly, instead use :meth:`dataikuapi.dss.projectfolder.DSSProjectFolder.get_settings`
114+
"""
115+
def __init__(self, client, project_folder_id, settings):
116+
self.client = client
117+
self.project_folder_id = project_folder_id
118+
self.settings = settings
137119

138-
def get_raw(self):
120+
def get_raw(self):
139121
"""Gets all settings as a raw dictionary. This returns a reference to the raw settings, not a copy,
140122
so changes made to the returned object will be reflected when saving.
141123

0 commit comments

Comments
 (0)