Skip to content

Commit 6353c82

Browse files
committed
reverting deep copy change and using to_dict instead
1 parent a19ae8a commit 6353c82

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

python/hsfs/core/feature_group_engine.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#
1515
from __future__ import annotations
1616

17-
import copy
1817
import warnings
1918
from typing import List
2019

@@ -263,7 +262,7 @@ def sql(self, query, feature_store_name, dataframe_type, online, read_options):
263262
def _update_features_metadata(self, feature_group: fg.FeatureGroup, features):
264263
# perform changes on copy in case the update fails, so we don't leave
265264
# the user object in corrupted state
266-
copy_feature_group: fg.FeatureGroup = copy.deepcopy(feature_group)
265+
copy_feature_group = fg.FeatureGroup.from_response_json(feature_group.to_dict())
267266
copy_feature_group.features = features
268267
self._feature_group_api.update_metadata(
269268
feature_group, copy_feature_group, "updateMetadata"

python/hsfs/feature_group.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,9 @@ def to_dict(self) -> Dict[str, Any]:
35543554
"topicName": self.topic_name,
35553555
"notificationTopicName": self.notification_topic_name,
35563556
"deprecated": self.deprecated,
3557-
"transformationFunctions": self._transformation_functions,
3557+
"transformationFunctions": [
3558+
tf.to_dict() for tf in self._transformation_functions
3559+
],
35583560
}
35593561
if self._online_config:
35603562
fg_meta_dict["onlineConfig"] = self._online_config.to_dict()

python/hsfs/transformation_function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def to_dict(self) -> Dict[str, Any]:
227227
"id": self._id,
228228
"version": self._version,
229229
"featurestoreId": self._featurestore_id,
230-
"hopsworksUdf": self._hopsworks_udf,
230+
"hopsworksUdf": self._hopsworks_udf.to_dict(),
231231
}
232232

233233
def _get_output_column_names(self) -> str:

0 commit comments

Comments
 (0)