Sitelet https://github.com/feast-dev/feast/pull/6781
Skip to content

feat: Add feature view versioning support to Elasticsearch online store - #6781

Open
alekseevpavel04 wants to merge 1 commit into
feast-dev:masterfrom
alekseevpavel04:feat/elasticsearch-fv-versioning
Open

feat: Add feature view versioning support to Elasticsearch online store#6781
alekseevpavel04 wants to merge 1 commit into
feast-dev:masterfrom
alekseevpavel04:feat/elasticsearch-fv-versioning

Conversation

@alekseevpavel04

Copy link
Copy Markdown

What this PR does / why we need it:

Adds versioned read/write support for feature views to the Elasticsearch online
store, so that a version-qualified reference like driver_stats@v2:trips_today
resolves to that version's data.

Before this, Elasticsearch named every index after the bare feature view name,
and the store was not among the types
OnlineStore._check_versioned_read_support accepts — so a versioned reference
raised VersionedOnlineReadNotSupported no matter what was in the store.

Elasticsearch keeps one index per feature view, so the version belongs in the
index name, which is the shape the SQL stores and Cassandra already use. The
new module-level _versioned_index_name wraps the existing
compute_versioned_name helper the same way redis.py does, and every path
that names an index goes through it:

path site
online_write_batch the bulk _index, and the _index_has_value_num mapping probe
online_read the search
create_index indices.create
update delete_by_query for dropped views, create_index for kept ones
teardown indices.delete
retrieve_online_documents, retrieve_online_documents_v2 both searches

ElasticSearchOnlineStore is also added to the supported list in
online_store.py. Both halves are needed: renaming alone still refuses every
versioned read, and the list entry alone would accept the reference and then
read the unversioned index.

Backward compatible. The index name is unchanged when
enable_online_feature_view_versioning is off, and when the resolved version is
0 — so existing deployments keep the indices they have, and nothing moves until
the flag is turned on. _bulk_batch_actions now takes the resolved index name
instead of the FeatureView; it is private and online_write_batch is its only
caller.

Which issue(s) this PR fixes:

Fixes #6172

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

sdk/python/tests/unit/infra/online_store/test_elasticsearch_versioning.py, 17
tests, following test_redis_versioning.py: the name the helper resolves
(including version 0 and projection.version_tag taking priority over
current_version_number), the index each store path actually asks for, and that
the store now passes _check_versioned_read_support.

Checked that they fail without the change, in two halves. Reverting only
elasticsearch.py gives 14 failures of the form
assert 'driver_stats' == 'driver_stats_v2'; reverting only online_store.py
gives 2, with VersionedOnlineReadNotSupported: Versioned feature reads (@v2) are not yet supported by ElasticSearchOnlineStore.

Full unit suite, run in two halves: 1258 passed / 20 skipped and 1398
passed / 24 skipped
, no failures, against a baseline of 1241 / 20 and 1398 /
24 taken on the same commit before the change — so the only difference is the 17
new tests. ruff format --check and ruff check are clean on the three files.

Misc

Integration tests are not included: the Elasticsearch integration suite needs a
live instance, and the six stores that already have this feature test it in the
unit suite, one test_<store>_versioning.py file each. This follows that.

One thing I noticed and did not touch: VersionedOnlineReadNotSupported in
errors.py lists the supporting stores by hand, and that sentence is already
missing Milvus. Happy to update it here if you would like it to stay accurate.

Versioned feature references such as `driver_stats@v2:trips_today` were
refused by the Elasticsearch online store: every path named its index after
the bare feature view name, and the store was not on the list of stores that
`OnlineStore._check_versioned_read_support` accepts, so a versioned read
raised `VersionedOnlineReadNotSupported`.

Elasticsearch keeps one index per feature view, so the version belongs in the
index name, the same shape Cassandra and the SQL stores use. All nine sites
that name an index now go through `_versioned_index_name`, which wraps the
existing `compute_versioned_name` helper the way `redis.py` does: the write
and its mapping probe, `online_read`, `create_index`, `update`, `teardown`,
and both `retrieve_online_documents` paths.

The index name is unchanged when `enable_online_feature_view_versioning` is
off and when the version is 0, so existing deployments keep the indices they
have and the flag stays opt-in.

Fixes feast-dev#6172

Signed-off-by: Pavel Alekseev <alekceevpavel@mail.ru>
@alekseevpavel04
alekseevpavel04 requested review from a team as code owners August 25, 2026 11:42
@alekseevpavel04
alekseevpavel04 requested review from ejscribner, robhowley and shuchu and removed request for a team August 25, 2026 11:42
@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.28%. Comparing base (8ab92e8) to head (445ceeb).

Files with missing lines Patch % Lines
...stores/elasticsearch_online_store/elasticsearch.py 83.33% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6781      +/-   ##
==========================================
+ Coverage   47.08%   47.28%   +0.19%     
==========================================
  Files         419      419              
  Lines       51878    51882       +4     
  Branches     7525     7525              
==========================================
+ Hits        24429    24534     +105     
+ Misses      25700    25587     -113     
- Partials     1749     1761      +12     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.61% <83.33%> (+0.21%) ⬆️
Files with missing lines Coverage Δ
...k/python/feast/infra/online_stores/online_store.py 70.38% <ø> (ø)
...stores/elasticsearch_online_store/elasticsearch.py 32.26% <83.33%> (+32.26%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ab92e8...445ceeb. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add feature view versioning support to Elasticsearch online store

3 participants