Skip to content

Commit 66d2c76

Browse files
authored
chore: Update offline and online store docs (#3048)
* Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> * Fix Signed-off-by: Kevin Zhang <[email protected]> Signed-off-by: Kevin Zhang <[email protected]>
1 parent 492a90d commit 66d2c76

File tree

3 files changed

+48
-8
lines changed

3 files changed

+48
-8
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ test-python-universal-postgres-online:
209209
test-python-universal-cassandra:
210210
PYTHONPATH='.' \
211211
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.online_stores.contrib.cassandra_repo_configuration \
212+
PYTEST_PLUGINS=sdk.python.tests.integration.feature_repos.universal.online_store.cassandra \
212213
FEAST_USAGE=False \
213214
IS_TEST=True \
214215
python -m pytest -x --integration \
@@ -217,6 +218,7 @@ test-python-universal-cassandra:
217218
test-python-universal-cassandra-no-cloud-providers:
218219
PYTHONPATH='.' \
219220
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.online_stores.contrib.cassandra_repo_configuration \
221+
PYTEST_PLUGINS=sdk.python.tests.integration.feature_repos.universal.online_store.cassandra \
220222
FEAST_USAGE=False \
221223
IS_TEST=True \
222224
python -m pytest -x --integration \

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,37 @@ Even if you have created the `OfflineStore` class in a separate repo, you can st
406406
```
407407

408408
If the integration tests fail, this indicates that there is a mistake in the implementation of this offline store!
409-
5. Remember to add your datasource to `repo_config.py` similar to how we added `spark`, `trino`, etc, to the dictionary `OFFLINE_STORE_CLASS_FOR_TYPE` and add the necessary configuration to `repo_configuration.py`. Namely, `AVAILABLE_OFFLINE_STORES` should load your repo configuration module.
409+
410+
5. Remember to add your datasource to `repo_config.py` similar to how we added `spark`, `trino`, etc, to the dictionary `OFFLINE_STORE_CLASS_FOR_TYPE`. This will allow Feast to load your class from the `feature_store.yaml`.
411+
412+
6. Finally, add a Makefile target to the Makefile to run your datastore specific tests by setting the `FULL_REPO_CONFIGS_MODULE` and `PYTEST_PLUGINS` environment variable. The `PYTEST_PLUGINS` environment variable allows pytest to load in the `DataSourceCreator` for your datasource. You can remove certain tests that are not relevant or still do not work for your datastore using the `-k` option.
413+
414+
{% code title="Makefile" %}
415+
```Makefile
416+
test-python-universal-spark:
417+
PYTHONPATH='.' \
418+
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.spark_repo_configuration \
419+
PYTEST_PLUGINS=feast.infra.offline_stores.contrib.spark_offline_store.tests \
420+
FEAST_USAGE=False IS_TEST=True \
421+
python -m pytest -n 8 --integration \
422+
-k "not test_historical_retrieval_fails_on_validation and \
423+
not test_historical_retrieval_with_validation and \
424+
not test_historical_features_persisting and \
425+
not test_historical_retrieval_fails_on_validation and \
426+
not test_universal_cli and \
427+
not test_go_feature_server and \
428+
not test_feature_logging and \
429+
not test_reorder_columns and \
430+
not test_logged_features_validation and \
431+
not test_lambda_materialization_consistency and \
432+
not test_offline_write and \
433+
not test_push_features_to_offline_store.py and \
434+
not gcs_registry and \
435+
not s3_registry and \
436+
not test_universal_types" \
437+
sdk/python/tests
438+
```
439+
{% endcode %}
410440

411441
### 7. Dependencies
412442

docs/how-to-guides/customizing-feast/adding-support-for-a-new-online-store.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ online_store: feast_custom_online_store.mysql.MySQLOnlineStore
318318

319319
## 4. Testing the OnlineStore class
320320

321-
### Integrating with the integration test suite and unit test suite.
321+
### 4.1 Integrating with the integration test suite and unit test suite.
322322

323323
Even if you have created the `OnlineStore` class in a separate repo, you can still test your implementation against the Feast test suite, as long as you have Feast as a submodule in your repo.
324324

@@ -352,7 +352,7 @@ If you are planning to start the online store up locally(e.g spin up a local Red
352352
}
353353
```
354354

355-
If you are planning instead to use a Dockerized container to run your tests against your online store, you can define a `OnlineStoreCreator` and replace the `None` object above with your `OnlineStoreCreator` class.
355+
If you are planning instead to use a Dockerized container to run your tests against your online store, you can define a `OnlineStoreCreator` and replace the `None` object above with your `OnlineStoreCreator` class. You should make this class available to pytest through the `PYTEST_PLUGINS` environment variable.
356356

357357
If you create a containerized docker image for testing, developers who are trying to test with your online store will not have to spin up their own instance of the online store for testing. An example of an `OnlineStoreCreator` is shown below:
358358

@@ -372,12 +372,20 @@ class RedisOnlineStoreCreator(OnlineStoreCreator):
372372
```
373373
{% endcode %}
374374

375-
3\. You should swap out the `FULL_REPO_CONFIGS` environment variable and run the integration tests against your online store. In the example repo, the file that overwrites `FULL_REPO_CONFIGS` is `feast_custom_online_store/feast_tests.py`, so you would run:
376-
377-
```bash
378-
export FULL_REPO_CONFIGS_MODULE='feast_custom_online_store.feast_tests'
379-
make test-python-universal
375+
3\. Add a Makefile target to the Makefile to run your datastore specific tests by setting the `FULL_REPO_CONFIGS_MODULE` environment variable. Add `PYTEST_PLUGINS` if pytest is having trouble loading your `DataSourceCreator`. You can remove certain tests that are not relevant or still do not work for your datastore using the `-k` option.
376+
377+
{% code title="Makefile" %}
378+
```Makefile
379+
test-python-universal-cassandra:
380+
PYTHONPATH='.' \
381+
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.online_stores.contrib.cassandra_repo_configuration \
382+
PYTEST_PLUGINS=sdk.python.tests.integration.feature_repos.universal.online_store.cassandra \
383+
FEAST_USAGE=False \
384+
IS_TEST=True \
385+
python -m pytest -x --integration \
386+
sdk/python/tests
380387
```
388+
{% endcode %}
381389

382390
* If there are some tests that fail, this indicates that there is a mistake in the implementation of this online store!
383391

0 commit comments

Comments
 (0)