From 927f0735a54e7738e124acaf344c31703534176d Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Fri, 20 Jan 2023 10:47:17 -0800 Subject: [PATCH 1/2] Ensure no duplicates in `fv.schema` Signed-off-by: Felix Wang --- sdk/python/feast/feature_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/feast/feature_view.py b/sdk/python/feast/feature_view.py index 53b2099432..d91ee9080d 100644 --- a/sdk/python/feast/feature_view.py +++ b/sdk/python/feast/feature_view.py @@ -259,7 +259,7 @@ def join_keys(self) -> List[str]: @property def schema(self) -> List[Field]: - return self.entity_columns + self.features + return list(set(self.entity_columns + self.features)) def ensure_valid(self): """ From 91cd45f0ebdcc1466f14d7900de0bffdb9fb24d1 Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Fri, 20 Jan 2023 10:52:20 -0800 Subject: [PATCH 2/2] Fix `Field.__eq__` to check all attributes Signed-off-by: Felix Wang --- sdk/python/feast/field.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/python/feast/field.py b/sdk/python/feast/field.py index d3bdf56392..245bb24f52 100644 --- a/sdk/python/feast/field.py +++ b/sdk/python/feast/field.py @@ -30,11 +30,13 @@ class Field: Attributes: name: The name of the field. dtype: The type of the field, such as string or float. - tags (optional): User-defined metadata in dictionary form. + description: A human-readable description. + tags: User-defined metadata in dictionary form. """ name: str dtype: FeastType + description: str tags: Dict[str, str] def __init__( @@ -51,6 +53,7 @@ def __init__( Args: name: The name of the field. dtype: The type of the field, such as string or float. + description (optional): A human-readable description. tags (optional): User-defined metadata in dictionary form. """ self.name = name @@ -65,6 +68,7 @@ def __eq__(self, other): if ( self.name != other.name or self.dtype != other.dtype + or self.description != other.description or self.tags != other.tags ): return False