Skip to content

Commit 5287bdd

Browse files
committed
Feature store public API
1 parent ef2ca0a commit 5287bdd

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

dataikuapi/dss/dataset.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,26 @@ def add_time_partitioning_dimension(self, dim_name, period="DAY"):
737737
def add_raw_schema_column(self, column):
738738
self.settings["schema"]["columns"].append(column)
739739

740+
@property
741+
def is_feature_group(self):
742+
"""
743+
Indicates whether the Dataset is defined as a Feature Group, available in the Feature Store.
744+
Changes of this property will be applied when calling :meth:`save` and require the "Manage Feature Store" permission.
745+
746+
:rtype: bool
747+
"""
748+
return self.settings["featureGroup"]
749+
750+
def set_feature_group(self, status):
751+
"""
752+
Indicates whether the Dataset is defined as a Feature Group, available in the Feature Store.
753+
Changes of this property will be applied when calling :meth:`save` and require the "Manage Feature Store" permission.
754+
755+
:param status: whether the dataset should be defined as a feature group
756+
:type status: bool
757+
"""
758+
self.settings["featureGroup"] = status
759+
740760
def save(self):
741761
self.dataset.client._perform_empty(
742762
"PUT", "/projects/%s/datasets/%s" % (self.dataset.project_key, self.dataset.dataset_name),

dataikuapi/dss/feature_store.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class DSSFeatureStore(object):
2+
def __init__(self, client):
3+
"""
4+
A handle on the Feature Store. Do not call this methid directly, call """
5+
self.client = client
6+
7+
def list_feature_groups(self):
8+
"""
9+
Get a list of names of datasets defined as feature groups on the DSS instance.
10+
11+
:return: list of names of datasets defined as feature groups
12+
:rtype: list of str
13+
"""
14+
return self.client._perform_json("GET", "/feature-store/feature-groups/list")

dataikuapi/dssclient.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from requests import exceptions
55
from requests.auth import HTTPBasicAuth
66

7+
from .dss.feature_store import DSSFeatureStore
78
from .dss.notebook import DSSNotebook
89
from .dss.future import DSSFuture
910
from .dss.projectfolder import DSSProjectFolder
@@ -1118,6 +1119,14 @@ def get_object_discussions(self, project_key, object_type, object_id):
11181119
"""
11191120
return DSSObjectDiscussions(self, project_key, object_type, object_id)
11201121

1122+
########################################################
1123+
# Feature Store
1124+
########################################################
1125+
def get_feature_store(self):
1126+
return DSSFeatureStore(self)
1127+
1128+
1129+
11211130
class TemporaryImportHandle(object):
11221131
def __init__(self, client, import_id):
11231132
self.client = client

0 commit comments

Comments
 (0)