Comment on page
Feast users use Feast to manage two important sets of configuration:
- Configuration about how to run Feast on your infrastructure
- Feature definitions
With Feast, the above configuration can be written declaratively and stored as code in a central location. This central location is called a feature repository. The feature repository is the declarative source of truth for what the desired state of a feature store should be.
The Feast CLI uses the feature repository to configure, deploy, and manage your feature store.
A feature repository consists of:
- A collection of Python files containing feature declarations.
feature_store.yamlfile containing infrastructural configuration.
.feastignorefile containing paths in the feature repository to ignore.
Typically, users store their feature repositories in a Git repository, especially when working in teams. However, using Git is not a requirement.
The structure of a feature repository is as follows:
- The root of the repository should contain a
feature_store.yamlfile and may contain a
- The repository should contain Python files that contain feature definitions.
- The repository can contain other files as well, including documentation and potentially data files.
An example structure of a feature repository is shown below:
$ tree -a
│ └── driver_stats.parquet
1 directory, 4 files
A couple of things to note about the feature repository:
- Feast reads all Python files recursively when
feast applyis ran, including subdirectories, even if they don't contain feature definitions.
- It's recommended to add
.feastignoreand add paths to all imperative scripts if you need to store them inside the feature registry.
The configuration for a feature store is stored in a file named
feature_store.yaml, which must be located at the root of a feature repository. An example
feature_store.yamlfile is shown below:
This file contains paths that should be ignored when running
feast apply. An example
.feastignoreis shown below:
# Ignore virtual environment
# Ignore a specific Python file
# Ignore all Python files directly under scripts directory
# Ignore all "foo.py" anywhere under scripts directory
A feature repository can also contain one or more Python files that contain feature definitions. An example feature definition file is shown below:
from datetime import timedelta
from feast import BigQuerySource, Entity, Feature, FeatureView, Field
from feast.types import Float32, Int64, String
driver_locations_source = BigQuerySource(
driver = Entity(
driver_locations = FeatureView(