Skip to content

Commit e1c9ead

Browse files
committed
added the ability to see the path of a pf
1 parent a6ed8f8 commit e1c9ead

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

dataikuapi/dss/projectfolder.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ def get_name(self):
2121
"""
2222
return self.client._perform_json("GET", "/project-folders/%s" % self.project_folder_id).get("name", None)
2323

24+
def get_path(self):
25+
"""
26+
Get this project fodler's path based on the root project folder
27+
28+
:returns str: the path of this project folder
29+
"""
30+
definition = self.client._perform_json("GET", "/project-folders/%s" % self.project_folder_id)
31+
parent_id = definition.get("parent", None)
32+
if parent_id is not None:
33+
parent = DSSProjectFolder(self.client, parent_id)
34+
return parent.get_path() + definition.get("name", "") + "/"
35+
else:
36+
return "/"
37+
2438
def get_parent(self):
2539
"""
2640
Get this project folder's parent or None if it is the root project folder

0 commit comments

Comments
 (0)