Skip to content

Commit c2e42d0

Browse files
committed
ensure ODFVs are always materialized for offline retrieval
Signed-off-by: lukas.valatka <lukas.valatka@cast.ai>
1 parent 6214d05 commit c2e42d0

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,17 @@ test-python-universal-spark: ## Run Python Spark integration tests
210210
not test_snowflake" \
211211
sdk/python/tests
212212

213+
test-python-historical-retrieval:
214+
## Run Python historical retrieval integration tests
215+
PYTHONPATH='.' \
216+
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.spark_repo_configuration \
217+
PYTEST_PLUGINS=feast.infra.offline_stores.contrib.spark_offline_store.tests \
218+
python -m pytest -n 8 --integration \
219+
-k "test_historical_retrieval_with_validation or \
220+
test_historical_features_persisting or \
221+
test_historical_retrieval_fails_on_validation" \
222+
sdk/python/tests
223+
213224
test-python-universal-trino: ## Run Python Trino integration tests
214225
PYTHONPATH='.' \
215226
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.trino_repo_configuration \

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,8 @@ exclude = [
264264
".pyi",
265265
"protos",
266266
"sdk/python/feast/embedded_go/lib"]
267+
268+
[dependency-groups]
269+
dev = [
270+
"pytest-xdist>=3.8.0",
271+
]

sdk/python/feast/feature_store.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,14 @@ def get_historical_features(
12331233
# TODO(achal): _group_feature_refs returns the on demand feature views, but it's not passed into the provider.
12341234
# This is a weird interface quirk - we should revisit the `get_historical_features` to
12351235
# pass in the on demand feature views as well.
1236+
1237+
# Deliberately disable writing to online store for ODFVs during historical retrieval
1238+
# since it's not applicable in this context.
1239+
# This does not change the output, since it forces to recompute ODFVs on historical retrieval
1240+
# but that is fine, since ODFVs precompute does not to work for historical retrieval (as per docs), only for online retrieval
1241+
for odfv in all_on_demand_feature_views:
1242+
odfv.write_to_online_store = False
1243+
12361244
fvs, odfvs = utils._group_feature_refs(
12371245
_feature_refs,
12381246
all_feature_views,

0 commit comments

Comments
 (0)