Skip to content

Commit

Permalink
corrections based on integration test failures
Browse files Browse the repository at this point in the history
Signed-off-by: David Y Liu <[email protected]>
  • Loading branch information
mavysavydav committed Oct 4, 2021
1 parent d65326d commit 659374a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def feature_service_list(ctx: click.Context):
feature_services = []
for feature_service in store.list_feature_services():
feature_names = []
for projection in feature_service.features:
for projection in feature_service.feature_view_projections:
feature_names.extend(
[f"{projection.name}:{feature.name}" for feature in projection.features]
)
Expand Down
16 changes: 11 additions & 5 deletions sdk/python/feast/feature_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def __eq__(self, other):
if self.tags != other.tags or self.name != other.name:
return False

if sorted(self.features) != sorted(other.features):
if sorted(self.feature_view_projections) != sorted(
other.feature_view_projections
):
return False

return True
Expand All @@ -98,22 +100,26 @@ def __eq__(self, other):
def from_proto(feature_service_proto: FeatureServiceProto):
"""
Converts a FeatureServiceProto to a FeatureService object.
Args:
feature_service_proto: A protobuf representation of a FeatureService.
"""
fs = FeatureService(
name=feature_service_proto.spec.name,
features=[
FeatureViewProjection.from_proto(projection)
for projection in feature_service_proto.spec.features
],
features=[],
tags=dict(feature_service_proto.spec.tags),
description=(
feature_service_proto.spec.description
if feature_service_proto.spec.description != ""
else None
),
)
fs.feature_view_projections.extend(
[
FeatureViewProjection.from_proto(projection)
for projection in feature_service_proto.spec.features
]
)

if feature_service_proto.meta.HasField("created_timestamp"):
fs.created_timestamp = (
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def _get_features(
"inconsistent with the version from Registry. Potentially a newer version"
"of the FeatureService has been applied to the registry."
)
for projection in feature_service_from_registry.features:
for projection in feature_service_from_registry.feature_view_projections:
_feature_refs.extend(
[f"{projection.name}:{f.name}" for f in projection.features]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ def assert_feature_service_correctness(

assert (
len(feature_service_keys)
== sum([len(projection.features) for projection in feature_service.features])
== sum(
[
len(projection.features)
for projection in feature_service.feature_view_projections
]
)
+ 3
) # Add two for the driver id and the customer id entity keys and val_to_add request data

Expand Down

0 comments on commit 659374a

Please sign in to comment.