Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address comments
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 committed Aug 18, 2022
commit 64dfdef1706b712fb82e92445c2b3a0554ec7853
10 changes: 7 additions & 3 deletions sdk/python/feast/base_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,14 @@ def __getitem__(self, item):

cp = self.__copy__()
if self.features:
feature_names = [feature.name for feature in self.features]
referenced_features = []
for feature in self.features:
if feature.name in item:
referenced_features.append(feature)
for feature in item:
if feature not in feature_names:
raise ValueError(
f"Feature {feature} does not exist in this feature view."
)
referenced_features.append(feature)
cp.projection.features = referenced_features
else:
cp.projection.desired_features = item
Expand Down
1 change: 1 addition & 0 deletions sdk/python/feast/feature_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def infer_features(self, fvs_to_update: Dict[str, FeatureView]):
# known schema, so no action needs to be taken.
# Example: FeatureService(features=[fv[["existing_feature"]]]), where

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also applies if the user is selecting from a fv with a known schema, but doesn't select features right?

# 'existing_feature' was defined as part of the schema of 'fv'.
# Example: FeatureService(features=[fv]), where 'fv' was defined with a schema.
continue

# The projection wants to select all possible inferred features.
Expand Down