5050
5151class FeatureView (BaseFeatureView ):
5252 """
53- A FeatureView defines a logical grouping of serveable features.
53+ A FeatureView defines a logical group of features.
5454
55- Args :
56- name: Name of the group of features .
57- entities: The entities to which this group of features is associated.
55+ Attributes :
56+ name: The unique name of the feature view .
57+ entities: The list of entities with which this group of features is associated.
5858 ttl: The amount of time this group of features lives. A ttl of 0 indicates that
5959 this group of features lives forever. Note that large ttl's or a ttl of 0
6060 can result in extremely computationally intensive queries.
6161 batch_source: The batch source of data where this group of features is stored.
6262 stream_source (optional): The stream source of data where this group of features
6363 is stored.
64- features (optional): The set of features defined as part of this FeatureView.
65- tags (optional): A dictionary of key-value pairs used for organizing
66- FeatureViews.
64+ features: The list of features defined as part of this feature view.
65+ online: A boolean indicating whether online retrieval is enabled for this feature
66+ view.
67+ description: A human-readable description.
68+ tags: A dictionary of key-value pairs to store arbitrary metadata.
69+ owner: The owner of the feature view, typically the email of the primary
70+ maintainer.
6771 """
6872
73+ name : str
6974 entities : List [str ]
70- tags : Optional [Dict [str , str ]]
7175 ttl : timedelta
72- online : bool
7376 batch_source : DataSource
7477 stream_source : Optional [DataSource ]
78+ features : List [Feature ]
79+ online : bool
80+ description : str
81+ tags : Dict [str , str ]
82+ owner : str
7583 materialization_intervals : List [Tuple [datetime , datetime ]]
7684
7785 @log_exceptions
@@ -83,12 +91,31 @@ def __init__(
8391 batch_source : DataSource ,
8492 stream_source : Optional [DataSource ] = None ,
8593 features : Optional [List [Feature ]] = None ,
86- tags : Optional [Dict [str , str ]] = None ,
8794 online : bool = True ,
95+ description : str = "" ,
96+ tags : Optional [Dict [str , str ]] = None ,
97+ owner : str = "" ,
8898 ):
8999 """
90100 Creates a FeatureView object.
91101
102+ Args:
103+ name: The unique name of the feature view.
104+ entities: The list of entities with which this group of features is associated.
105+ ttl: The amount of time this group of features lives. A ttl of 0 indicates that
106+ this group of features lives forever. Note that large ttl's or a ttl of 0
107+ can result in extremely computationally intensive queries.
108+ batch_source: The batch source of data where this group of features is stored.
109+ stream_source (optional): The stream source of data where this group of features
110+ is stored.
111+ features (optional): The list of features defined as part of this feature view.
112+ online (optional): A boolean indicating whether online retrieval is enabled for
113+ this feature view.
114+ description (optional): A human-readable description.
115+ tags (optional): A dictionary of key-value pairs to store arbitrary metadata.
116+ owner (optional): The owner of the feature view, typically the email of the
117+ primary maintainer.
118+
92119 Raises:
93120 ValueError: A field mapping conflicts with an Entity or a Feature.
94121 """
@@ -106,9 +133,8 @@ def __init__(
106133 f"Entity or Feature name."
107134 )
108135
109- super ().__init__ (name , _features )
136+ super ().__init__ (name , _features , description , tags , owner )
110137 self .entities = entities if entities else [DUMMY_ENTITY_NAME ]
111- self .tags = tags if tags is not None else {}
112138
113139 if isinstance (ttl , Duration ):
114140 self .ttl = timedelta (seconds = int (ttl .seconds ))
@@ -123,10 +149,9 @@ def __init__(
123149 else :
124150 self .ttl = ttl
125151
126- self .online = online
127152 self .batch_source = batch_source
128153 self .stream_source = stream_source
129-
154+ self . online = online
130155 self .materialization_intervals = []
131156
132157 # Note: Python requires redefining hash in child classes that override __eq__
@@ -312,7 +337,9 @@ def to_proto(self) -> FeatureViewProto:
312337 name = self .name ,
313338 entities = self .entities ,
314339 features = [feature .to_proto () for feature in self .features ],
340+ description = self .description ,
315341 tags = self .tags ,
342+ owner = self .owner ,
316343 ttl = (ttl_duration if ttl_duration is not None else None ),
317344 online = self .online ,
318345 batch_source = batch_source_proto ,
@@ -349,7 +376,9 @@ def from_proto(cls, feature_view_proto: FeatureViewProto):
349376 )
350377 for feature in feature_view_proto .spec .features
351378 ],
379+ description = feature_view_proto .spec .description ,
352380 tags = dict (feature_view_proto .spec .tags ),
381+ owner = feature_view_proto .spec .owner ,
353382 online = feature_view_proto .spec .online ,
354383 ttl = (
355384 None
0 commit comments