Skip to content

Commit a19ae8a

Browse files
committed
using deep copy to copy feature group object instead of from_response
1 parent 31ad5aa commit a19ae8a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

python/hsfs/core/feature_group_engine.py

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

17+
import copy
1718
import warnings
1819
from typing import List
1920

@@ -259,10 +260,10 @@ def sql(self, query, feature_store_name, dataframe_type, online, read_options):
259260
read_options,
260261
)
261262

262-
def _update_features_metadata(self, feature_group, features):
263+
def _update_features_metadata(self, feature_group: fg.FeatureGroup, features):
263264
# perform changes on copy in case the update fails, so we don't leave
264265
# the user object in corrupted state
265-
copy_feature_group = fg.FeatureGroup.from_response_json(feature_group.to_dict())
266+
copy_feature_group: fg.FeatureGroup = copy.deepcopy(feature_group)
266267
copy_feature_group.features = features
267268
self._feature_group_api.update_metadata(
268269
feature_group, copy_feature_group, "updateMetadata"

python/hsfs/hopsworks_udf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def _extract_source_code(udf_function: Callable) -> str:
315315
except FileNotFoundError:
316316
module_imports = [""]
317317
warnings.warn(
318-
"Cannot extract imported dependencies for the function module. Please make sure to import all dependencies for the UDF inside the function.",
318+
"Cannot extract imported dependencies for the UDF from the module in which it is defined. Please make sure to import all dependencies for the UDF inside the function.",
319319
stacklevel=2,
320320
)
321321

0 commit comments

Comments
 (0)