From 473f8d93fa8d565e53fc59b3c444a1b8ed061c51 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Fri, 3 Feb 2023 15:11:47 -0500 Subject: [PATCH] fix: Add description attribute to the Field.from_proto method (#3469) * fix: Add description attribute to the from_proto method Signed-off-by: gbmarc1 * lint Signed-off-by: Danny Chiao --------- Signed-off-by: gbmarc1 Signed-off-by: Danny Chiao Co-authored-by: Danny Chiao --- sdk/python/feast/field.py | 1 + sdk/python/tests/unit/test_feature.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sdk/python/feast/field.py b/sdk/python/feast/field.py index 245bb24f52..b07bddfeac 100644 --- a/sdk/python/feast/field.py +++ b/sdk/python/feast/field.py @@ -109,6 +109,7 @@ def from_proto(cls, field_proto: FieldProto): name=field_proto.name, dtype=from_value_type(value_type=value_type), tags=dict(field_proto.tags), + description=field_proto.description, ) @classmethod diff --git a/sdk/python/tests/unit/test_feature.py b/sdk/python/tests/unit/test_feature.py index a8cfeef3da..ca0dce4445 100644 --- a/sdk/python/tests/unit/test_feature.py +++ b/sdk/python/tests/unit/test_feature.py @@ -27,3 +27,6 @@ def test_field_serialization_with_description(): assert serialized_field.description == expected_description assert field_from_feature.description == expected_description + + field = Field.from_proto(serialized_field) + assert field.description == expected_description