@@ -30,7 +30,7 @@ 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: User-defined metadata in dictionary form.
33+ tags (optional) : User-defined metadata in dictionary form.
3434 """
3535
3636 name : str
@@ -42,6 +42,7 @@ def __init__(
4242 * ,
4343 name : str ,
4444 dtype : FeastType ,
45+ description : str = "" ,
4546 tags : Optional [Dict [str , str ]] = None ,
4647 ):
4748 """
@@ -54,6 +55,7 @@ def __init__(
5455 """
5556 self .name = name
5657 self .dtype = dtype
58+ self .description = description
5759 self .tags = tags or {}
5860
5961 def __eq__ (self , other ):
@@ -83,7 +85,12 @@ def __str__(self):
8385 def to_proto (self ) -> FieldProto :
8486 """Converts a Field object to its protobuf representation."""
8587 value_type = self .dtype .to_value_type ()
86- return FieldProto (name = self .name , value_type = value_type .value , tags = self .tags )
88+ return FieldProto (
89+ name = self .name ,
90+ value_type = value_type .value ,
91+ description = self .description ,
92+ tags = self .tags ,
93+ )
8794
8895 @classmethod
8996 def from_proto (cls , field_proto : FieldProto ):
@@ -109,5 +116,8 @@ def from_feature(cls, feature: Feature):
109116 feature: Feature object to convert.
110117 """
111118 return cls (
112- name = feature .name , dtype = from_value_type (feature .dtype ), tags = feature .labels
119+ name = feature .name ,
120+ dtype = from_value_type (feature .dtype ),
121+ description = feature .description ,
122+ tags = feature .labels ,
113123 )
0 commit comments