Skip to content

Commit 163cbb4

Browse files
authored
chore: Add documentation for custom offline stores (#2430)
* Add documentation Signed-off-by: Kevin Zhang <kzhang@tecton.ai> * Fix typo Signed-off-by: Kevin Zhang <kzhang@tecton.ai> * Address review Signed-off-by: Kevin Zhang <kzhang@tecton.ai> * Address review issues Signed-off-by: Kevin Zhang <kzhang@tecton.ai>
1 parent 5e6d9bc commit 163cbb4

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎docs/how-to-guides/adding-a-new-offline-store.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ The OfflineStore class contains a couple of methods to read features from the of
2828
There are two methods that deal with reading data from the offline stores`get_historical_features`and `pull_latest_from_table_or_query`.
2929

3030
* `pull_latest_from_table_or_query` is invoked when running materialization (using the `feast materialize` or `feast materialize-incremental` commands, or the corresponding `FeatureStore.materialize()` method. This method pull data from the offline store, and the `FeatureStore` class takes care of writing this data into the online store.
31-
* `get_historical_features `is invoked when reading values from the offline store using the `FeatureStore.get_historica_features()` method. Typically, this method is used to retrieve features when training ML models.
31+
* `get_historical_features` is invoked when reading values from the offline store using the `FeatureStore.get_historical_features()` method. Typically, this method is used to retrieve features when training ML models.
32+
* `pull_all_from_table_or_query` is a method that pulls all the data from an offline store from a specified start date to a specified end date.
3233

3334
{% code title="feast_custom_offline_store/file.py" %}
3435
```python
@@ -223,7 +224,7 @@ To use our custom file offline store, we can use the following `feature_store.ya
223224
project: test_custom
224225
registry: data/registry.db
225226
provider: local
226-
offline_store:
227+
offline_store:
227228
type: feast_custom_offline_store.file.CustomFileOfflineStore
228229
```
229230
{% endcode %}

‎sdk/python/feast/infra/offline_stores/offline_store.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,24 @@ def pull_latest_from_table_or_query(
179179
end_date: datetime,
180180
) -> RetrievalJob:
181181
"""
182+
This method pulls data from the offline store, and the FeatureStore class is used to write
183+
this data into the online store. This method is invoked when running materialization (using
184+
the `feast materialize` or `feast materialize-incremental` commands, or the corresponding
185+
FeatureStore.materialize() method. This method pulls data from the offline store, and the FeatureStore
186+
class is used to write this data into the online store.
187+
182188
Note that join_key_columns, feature_name_columns, event_timestamp_column, and created_timestamp_column
183189
have all already been mapped to column names of the source table and those column names are the values passed
184190
into this function.
191+
192+
Args:
193+
config: Repo configuration object
194+
data_source: Data source to pull all of the columns from
195+
join_key_columns: Columns of the join keys
196+
feature_name_columns: Columns of the feature names needed
197+
event_timestamp_column: Timestamp column
198+
start_date: Starting date of query
199+
end_date: Ending date of query
185200
"""
186201
pass
187202

@@ -210,8 +225,19 @@ def pull_all_from_table_or_query(
210225
end_date: datetime,
211226
) -> RetrievalJob:
212227
"""
228+
Returns a Retrieval Job for all join key columns, feature name columns, and the event timestamp columns that occur between the start_date and end_date.
229+
213230
Note that join_key_columns, feature_name_columns, event_timestamp_column, and created_timestamp_column
214231
have all already been mapped to column names of the source table and those column names are the values passed
215232
into this function.
233+
234+
Args:
235+
config: Repo configuration object
236+
data_source: Data source to pull all of the columns from
237+
join_key_columns: Columns of the join keys
238+
feature_name_columns: Columns of the feature names needed
239+
event_timestamp_column: Timestamp column
240+
start_date: Starting date of query
241+
end_date: Ending date of query
216242
"""
217243
pass

0 commit comments

Comments
 (0)