Creates an OnDemandFeatureView object. Args: name: The unique name of the on demand feature view. entities (optional): The list of names of entities that this feature view is associated with. schema: The list of features in the output of the on d
( # noqa: C901
self,
*,
name: str,
entities: Optional[List[Entity]] = None,
schema: Optional[List[Field]] = None,
sources: Optional[List[OnDemandSourceType]] = None,
input_schema: Optional[List[Field]] = None,
udf: Optional[FunctionType] = None,
udf_string: Optional[str] = "",
feature_transformation: Optional[Transformation] = None,
mode: str = "pandas",
description: str = "",
tags: Optional[dict[str, str]] = None,
owner: str = "",
org: str = "",
write_to_online_store: bool = False,
singleton: bool = False,
track_metrics: bool = False,
aggregations: Optional[List[Aggregation]] = None,
version: str = "latest",
enabled: bool = True,
)
| 160 | _raw_feature_transformation_proto: Optional[Any] = None |
| 161 | |
| 162 | def __init__( # noqa: C901 |
| 163 | self, |
| 164 | *, |
| 165 | name: str, |
| 166 | entities: Optional[List[Entity]] = None, |
| 167 | schema: Optional[List[Field]] = None, |
| 168 | sources: Optional[List[OnDemandSourceType]] = None, |
| 169 | input_schema: Optional[List[Field]] = None, |
| 170 | udf: Optional[FunctionType] = None, |
| 171 | udf_string: Optional[str] = "", |
| 172 | feature_transformation: Optional[Transformation] = None, |
| 173 | mode: str = "pandas", |
| 174 | description: str = "", |
| 175 | tags: Optional[dict[str, str]] = None, |
| 176 | owner: str = "", |
| 177 | org: str = "", |
| 178 | write_to_online_store: bool = False, |
| 179 | singleton: bool = False, |
| 180 | track_metrics: bool = False, |
| 181 | aggregations: Optional[List[Aggregation]] = None, |
| 182 | version: str = "latest", |
| 183 | enabled: bool = True, |
| 184 | ): |
| 185 | """ |
| 186 | Creates an OnDemandFeatureView object. |
| 187 | |
| 188 | Args: |
| 189 | name: The unique name of the on demand feature view. |
| 190 | entities (optional): The list of names of entities that this feature view is associated with. |
| 191 | schema: The list of features in the output of the on demand feature view, after |
| 192 | the transformation has been applied. |
| 193 | sources: A map from input source names to the actual input sources, which may be |
| 194 | feature views, or request data sources. These sources serve as inputs to the udf, |
| 195 | which will refer to them by name. |
| 196 | input_schema (optional): A list of Fields describing data that is accepted as input |
| 197 | but not stored directly as features — e.g. aggregation columns, normalization |
| 198 | parameters, thresholds, or other contextual values passed at request time. |
| 199 | When provided, sources is not required — an internal RequestSource will be |
| 200 | created automatically. |
| 201 | udf: The user defined transformation function, which must take pandas |
| 202 | dataframes as inputs. |
| 203 | udf_string: The source code version of the udf (for diffing and displaying in Web UI) |
| 204 | feature_transformation: The user defined transformation. |
| 205 | mode: Mode of execution (e.g., Pandas or Python native) |
| 206 | description (optional): A human-readable description. |
| 207 | tags (optional): A dictionary of key-value pairs to store arbitrary metadata. |
| 208 | owner (optional): The owner of the on demand feature view, typically the email |
| 209 | of the primary maintainer. |
| 210 | org (optional): The organizational unit that owns this feature view |
| 211 | (e.g. "ads", "search"). |
| 212 | write_to_online_store (optional): A boolean that indicates whether to write the on demand feature view to |
| 213 | the online store for faster retrieval. |
| 214 | singleton (optional): A boolean that indicates whether the transformation is executed on a singleton |
| 215 | (only applicable when mode="python"). |
| 216 | track_metrics (optional): Whether to emit Prometheus timing metrics |
| 217 | (``feast_feature_server_transformation_duration_seconds``) for |
| 218 | this ODFV. Defaults to ``False``. Set to ``True`` to opt in |
| 219 | to per-ODFV transformation duration tracking when the server |
nothing calls this directly
no test coverage detected