Skip to content

Commit

Permalink
docs: Add docs for the push source (#2461)
Browse files Browse the repository at this point in the history
* docs: Add docs for the push source

Signed-off-by: Achal Shah <achals@gmail.com>

* remove bad ref

Signed-off-by: Achal Shah <achals@gmail.com>

* cr

Signed-off-by: Achal Shah <achals@gmail.com>

* cr

Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals authored Mar 29, 2022
1 parent 5352ce7 commit 5acd9c4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/reference/data-sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ Please see [Data Source](../../getting-started/concepts/feature-view.md#data-sou
{% content-ref url="../offline-stores/spark.md" %}
[spark.md](../offline-stores/spark.md)
{% endcontent-ref %}

{% content-ref url="push.md" %}
[push.md](push.md)
{% endcontent-ref %}
42 changes: 42 additions & 0 deletions docs/reference/data-sources/push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Push source

## Description

Push sources allow feature values to be pushed to the online store in real time. This allows fresh feature values to be made available to applications. Push sources supercede the
[FeatureStore.write_to_online_store](https://rtd.feast.dev/en/latest/index.html#feast.feature_store.FeatureStore.write_to_online_store).

Push sources can be used by multiple feature views. When data is pushed to a push source, Feast propagates the feature values to all the consuming feature views.

Push sources must have a batch source specified, since that's the source used when retrieving historical features.
When using a PushSource as a stream source in the definition of a feature view, a batch source doesn't need to be specified in the definition explicitly.

## Example
### Defining a push source

```python
from feast import PushSource, ValueType, BigQuerySource, FeatureView, Feature

push_source = PushSource(
name="push_source",
schema={"user_id": ValueType.INT64, "life_time_value": ValueType.INT64},
batch_source=BigQuerySource(table="test.test"),
)

fv = FeatureView(
name="feature view",
entities=["user_id"],
features=[Feature(name="life_time_value", dtype=ValueType.INT64)],
stream_source=push_source,
)
```

### Pushing data
```python
from feast import FeatureStore
import pandas as pd

fs = FeatureStore(...)
feature_data_frame = pd.DataFrame()
fs.push("push_source", feature_data_frame)
```

0 comments on commit 5acd9c4

Please # to comment.