Skip to content

Commit 05334ae

Browse files
committed
Adding a DSSFeatureGroupListItem class
1 parent 370425a commit 05334ae

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

dataikuapi/dss/feature_store.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
from dataikuapi.dss.dataset import DSSDataset
2+
3+
4+
class DSSFeatureGroupListItem(object):
5+
def __init__(self, client, project_key, name):
6+
self.client = client
7+
self.project_key = project_key
8+
self.name = name
9+
10+
@property
11+
def id(self):
12+
return self.project_key + "." + self.name
13+
14+
def get_as_dataset(self):
15+
return DSSDataset(self.client, self.project_key, self.name)
16+
17+
118
class DSSFeatureStore(object):
219
def __init__(self, client):
320
"""
@@ -14,4 +31,5 @@ def list_feature_groups(self):
1431
:return: list of dataset names
1532
:rtype: list of str
1633
"""
17-
return self.client._perform_json("GET", "/feature-store/feature-groups/list")
34+
items = self.client._perform_json("GET", "/feature-store/feature-groups")
35+
return [DSSFeatureGroupListItem(self.client, item["projectKey"], item["name"]) for item in items]

0 commit comments

Comments
 (0)