feat: Add feature view versioning to Couchbase online store - #6754
Open
arose26 wants to merge 1 commit into
Open
feat: Add feature view versioning to Couchbase online store#6754arose26 wants to merge 1 commit into
arose26 wants to merge 1 commit into
Conversation
Resolve the Couchbase scope and collection through a single helper built on
compute_table_id, so that with registry.enable_online_feature_view_versioning
enabled each feature view version gets its own scope and collection
(test_project_driver_stats_v2_scope) instead of all versions sharing one.
Couchbase already namespaced by {project}_{table.name}, so this follows the
same compute_table_id convention as the Milvus and FAISS stores and the name
is unchanged when versioning is disabled.
Document ids are deliberately left unversioned: a Couchbase collection is
already a namespace, so partitioning at the collection level is enough to keep
versions from colliding, and existing ids stay stable.
Couchbase's online_read honours the OnlineStore contract - one entry per
requested entity key, in order, holding ValueProto values, (None, None) on a
miss - so CouchbaseOnlineStore is added to the versioned-read allowlist.
Also adds Milvus to the VersionedOnlineReadNotSupported message, which has
listed it as unsupported since it was allowlisted.
Part of feast-dev#2728. Closes feast-dev#6171
Signed-off-by: arose26 <145766958+arose26@users.noreply.github.com>
arose26
requested review from
ejscribner,
robhowley and
shuchu
and removed request for
a team
August 18, 2026 11:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6171. Part of #2728.
What this does
Resolves the Couchbase scope and collection through a single
_scope_and_collectionhelper, so that with
registry.enable_online_feature_view_versioning: trueeach featureview version gets its own scope and collection
(
test_project_driver_stats_v2_scope/..._v2_collection) instead of all versionssharing one. Applied to all four call sites —
online_write_batch,online_read,update,teardown.Couchbase already namespaced by
{project}_{table.name}, so this usescompute_table_id, the same convention as the merged Milvus (#6330) and FAISS(#6256) stores. With versioning disabled the names are byte-identical to today's, which
the
versioning=Falsecases pin.Two decisions worth calling out
Document ids are left unversioned.
_document_idstill returns{project}:{table.name}:{entity_key}:{feature}. A Couchbase collection is already anamespace, so partitioning at the collection level is sufficient to keep versions from
colliding, and leaving ids alone keeps them stable for existing data. Happy to version
them too if you'd rather have the version visible in the key.
Couchbase is added to the versioned-read allowlist in
OnlineStore._is_versioned_read_supported(). I checked the read path rather thanassuming:
CouchbaseOnlineStore.online_readhonours theOnlineStorecontract assqlite.pydefines it — one entry per requested entity key, in request order, holdingValueProtovalues parsed from the stored payload, and(None, None)onDocumentNotFoundException. So versioned reads genuinely work here once the collectionis version-scoped.
Drive-by: a stale error message
VersionedOnlineReadNotSupportedlisted "SQLite, PostgreSQL, MySQL, FAISS, Redis, andDynamoDB" — but
_is_versioned_read_supported()has includedMilvusOnlineStoresince#6330, which updated
online_store.pywithout touchingerrors.py. So the message hasbeen telling Milvus users their store is unsupported while the code supported it. Added
Milvus alongside Couchbase. Happy to split this into its own PR if you'd prefer.
Tests
New
sdk/python/tests/unit/infra/online_store/test_couchbase_versioning.py, 11 tests,MagicMock-based in the same style as the mergedtest_milvus_versioning.py, andimportorskip-guarded oncouchbase._v2when on;projection.version_tagtakes priority overcurrent_version_number; version0getsno suffix; two versions never collide
updateconnects with and creates the versioned scope,teardowndrops theversioned scope — parametrized so the unversioned case is asserted as the control
_is_versioned_read_supported()is true, and_check_versioned_read_supportno longer raises for a version-qualified ref
Verified red-before/green-after: with the three source files reverted, the four
behavioural tests fail and the
versioning=Falsecontrol still passes, so they test thechange rather than the setup.
Regression check across the 55 unit test files touching online stores or versioning: the
set of failing and erroring tests is identical with and without this change (
diffofthe sorted
FAILED/ERRORlines is empty). Those pre-existing failures are missingoptional dependencies in my environment.
ruff check,ruff formatandmypyare cleanon all four files.
🤖 Written with Claude Code (Claude Opus 5), reviewed by @arose26.