forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds description attribute for features/fields (feast-dev#3425)
* Adding description as a first-class attribute for features/fields Signed-off-by: Amom Mendes <[email protected]> * Formatting Signed-off-by: Amom Mendes <[email protected]> Signed-off-by: Amom Mendes <[email protected]>
- Loading branch information
1 parent
41c0537
commit 26f4881
Showing
7 changed files
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from feast.field import Feature, Field | ||
from feast.types import Float32 | ||
from feast.value_type import ValueType | ||
|
||
|
||
def test_feature_serialization_with_description(): | ||
expected_description = "Average daily trips" | ||
feature = Feature( | ||
name="avg_daily_trips", dtype=ValueType.FLOAT, description=expected_description | ||
) | ||
serialized_feature = feature.to_proto() | ||
|
||
assert serialized_feature.description == expected_description | ||
|
||
|
||
def test_field_serialization_with_description(): | ||
expected_description = "Average daily trips" | ||
field = Field( | ||
name="avg_daily_trips", dtype=Float32, description=expected_description | ||
) | ||
feature = Feature( | ||
name="avg_daily_trips", dtype=ValueType.FLOAT, description=expected_description | ||
) | ||
|
||
serialized_field = field.to_proto() | ||
field_from_feature = Field.from_feature(feature) | ||
|
||
assert serialized_field.description == expected_description | ||
assert field_from_feature.description == expected_description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters