Skip to content

Commit 08ffa8d

Browse files
fix: Ensure no duplicates in fv.schema (feast-dev#3460)
* Ensure no duplicates in `fv.schema` Signed-off-by: Felix Wang <[email protected]> * Fix `Field.__eq__` to check all attributes Signed-off-by: Felix Wang <[email protected]> Signed-off-by: Felix Wang <[email protected]>
1 parent 1c7c491 commit 08ffa8d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sdk/python/feast/feature_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def join_keys(self) -> List[str]:
259259

260260
@property
261261
def schema(self) -> List[Field]:
262-
return self.entity_columns + self.features
262+
return list(set(self.entity_columns + self.features))
263263

264264
def ensure_valid(self):
265265
"""

sdk/python/feast/field.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ class Field:
3030
Attributes:
3131
name: The name of the field.
3232
dtype: The type of the field, such as string or float.
33-
tags (optional): User-defined metadata in dictionary form.
33+
description: A human-readable description.
34+
tags: User-defined metadata in dictionary form.
3435
"""
3536

3637
name: str
3738
dtype: FeastType
39+
description: str
3840
tags: Dict[str, str]
3941

4042
def __init__(
@@ -51,6 +53,7 @@ def __init__(
5153
Args:
5254
name: The name of the field.
5355
dtype: The type of the field, such as string or float.
56+
description (optional): A human-readable description.
5457
tags (optional): User-defined metadata in dictionary form.
5558
"""
5659
self.name = name
@@ -65,6 +68,7 @@ def __eq__(self, other):
6568
if (
6669
self.name != other.name
6770
or self.dtype != other.dtype
71+
or self.description != other.description
6872
or self.tags != other.tags
6973
):
7074
return False

0 commit comments

Comments
 (0)