Skip to content

Commit cfd0573

Browse files
authored
Python client ignore partition_key in feature group (#87)
Closes #86
1 parent fdd69ed commit cfd0573

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

python/hsfs/feature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ def partition(self):
7272

7373
@partition.setter
7474
def partition(self, partition):
75-
self._partition
75+
self._partition = partition

python/hsfs/feature_group.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ def __init__(
8484
self._default_storage = default_storage
8585
self._hudi_enabled = hudi_enabled
8686

87-
self._primary_key = primary_key
88-
self._partition_key = partition_key
87+
if id is None:
88+
# Initialized from the API
89+
self._primary_key = primary_key
90+
self._partition_key = partition_key
91+
else:
92+
# Initialized from the backend
93+
self._primary_key = [f.name for f in self._features if f.primary]
94+
self._partition_key = [f.name for f in self._features if f.partition]
8995

9096
self._feature_group_engine = feature_group_engine.FeatureGroupEngine(
9197
featurestore_id

0 commit comments

Comments
 (0)