Skip to main content

Ingesting and Serving

Ingesting and refreshing values​

Write feature rows into a view's history, then materialize the view to publish the latest values to the online store:

client.feature_store.write(store_id, "driver_stats", rows=[
{"driver_id": 1001, "event_timestamp": "2026-07-30T00:00:00Z", "conv_rate": 0.75, "acc_rate": 0.9},
])

client.feature_store.materialize(store_id, "driver_stats")

A batch view built over a source table needs no write: materializing it pulls the source's new rows into the history first, and the source is also pulled every five minutes. Materialization is incremental: it publishes only what changed since the last run and never moves an older value over a newer one. For streaming views, values update continuously as events arrive, and windowed aggregations (for example a 24-hour sum) are kept current automatically.

Serving features online​

Once a view is materialized, resolve the latest features for a set of entities. You send only the entity keys and receive the current feature values:

online = client.feature_store.get_online_features(
store_id, "driver_model_v1", entity_rows=[{"driver_id": 1001}]
)
print(online["results"])

Each result reports the resolved features and lists any that were missing (an entity with no value yet), so absent data is always visible and never silently filled in. You can set a maximum staleness so a value older than your tolerance is reported as missing rather than served stale.

Generating training data​

To train, ask for point-in-time correct features for a set of labeled examples. For each row, the feature store resolves each feature as of that row's event_timestamp, so a training set never contains information that was not yet known at that moment:

training = client.feature_store.get_historical_features(
store_id,
"driver_model_v1",
entity_rows=[
{"driver_id": 1001, "event_timestamp": "2026-07-30T12:00:00Z", "label": 1},
{"driver_id": 1002, "event_timestamp": "2026-07-30T12:00:00Z", "label": 0},
],
)
print(training["snapshot_url"], training["num_rows"])

The training set is delivered as a Parquet snapshot you read directly. For large label sets, point at a Parquet or CSV file in your storage instead of listing the rows inline:

training = client.feature_store.get_historical_features(
store_id, "driver_model_v1",
entity_s3_uri="s3://your-bucket/labels/train.parquet",
)