Skip to content

Commit

Permalink
Improve error message for checking feature keys (feathr-ai#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
enya-yx authored Jan 12, 2023
1 parent 3a76b1c commit 049ab9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions feathr_project/feathr/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def _valid_materialize_keys(self, features: List[str], allow_empty_key=False):
for feature in features:
new_keys = self._get_feature_key(feature)
if new_keys is None:
self.logger.error(f"Key of feature: {feature} is empty. If this feature is not from INPUT_CONTEXT, you might want to double check on the feature definition to see whether the key is empty or not.")
self.logger.error(f"Key of feature: {feature} is empty. Please confirm the feature is defined. In addition, if this feature is not from INPUT_CONTEXT, you might want to double check on the feature definition to see whether the key is empty or not.")
return False
# If only get one key and it's "NOT_NEEDED", it means the feature has an empty key.
if ','.join(new_keys) == "NOT_NEEDED" and not allow_empty_key:
Expand Down Expand Up @@ -697,7 +697,7 @@ def materialize_features(self, settings: MaterializationSettings, execution_conf
if feature in anchor_feature_names:
raise RuntimeError(f"Materializing features that are defined on INPUT_CONTEXT is not supported. {feature} is defined on INPUT_CONTEXT so you should remove it from the feature list in MaterializationSettings.")
if not self._valid_materialize_keys(feature_list):
raise RuntimeError(f"Invalid materialization features: {feature_list}, since they have different keys. Currently Feathr only supports materializing features of the same keys.")
raise RuntimeError(f"Invalid materialization features: {feature_list}, since they have different keys or they are not defined. Currently Feathr only supports materializing features of the same keys.")

if not allow_materialize_non_agg_feature:
# Check if there are non-aggregation features in the list
Expand Down

0 comments on commit 049ab9a

Please sign in to comment.