Repository navigation
fix: Keep HybridOnlineStore routing_tag across FeatureViews - #6769
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes HybridOnlineStore configuration mutation when processing multiple FeatureViews.
Changes:
- Builds backend configurations without mutating the caller.
- Preserves the hybrid configuration across update and teardown iterations.
- Adds regression tests for multi-backend routing and immutability.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
hybrid_online_store.py |
Preserves hybrid routing configuration. |
test_hybrid_online_store.py |
Adds regression coverage. |
Suppressed comments (2)
sdk/python/tests/unit/infra/online_store/test_hybrid_online_store.py:35
- Add the return annotation required for Python function signatures.
def repo_config():
sdk/python/tests/unit/infra/online_store/test_hybrid_online_store.py:70
- Add parameter and return annotations to this new Python function signature.
def test_update_routes_every_feature_view(repo_config, entity):
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
2d401f9 to
9d8a2c1
Compare
|
@franciscojavierarceo @ntkathole Could you approve the workflow runs on this PR? All checks are stuck on "action_required" since this is my first PR here, so none of them have run yet. Would appreciate a review afterwards — this fixes HybridOnlineStore dropping |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6769 +/- ##
==========================================
+ Coverage 53.19% 53.33% +0.14%
==========================================
Files 459 459
Lines 58400 58396 -4
Branches 8627 8625 -2
==========================================
+ Hits 31065 31145 +80
+ Misses 25224 25140 -84
Partials 2111 2111
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
@franciscojavierarceo @ntkathole The failing "Validate PR title" check ran against the old lowercase title. I've since fixed it to sentence case, but the re-run is stuck on "action_required". Could you approve the workflow runs so the checks can pass? The Copilot review comments are all addressed. |
|
@franciscojavierarceo @ntkathole I updated the branch with the latest master (no conflicts), which put the workflow runs back into "action_required". All checks, including the PR title check, had passed on the previous head. Could you approve the runs again when you have a moment? A review would be much appreciated too. Thanks! |
|
@ntkathole @franciscojavierarceo I merged the latest master into the branch again (no conflicts), which puts the workflow runs back into "action_required". Could you approve them and take a look at the change when you get a chance? It keeps HybridOnlineStore's |
|
@shuchu @ntkathole Gentle ping. The workflow runs are waiting on approval ("action_required"); all checks passed on an earlier head. Could one of you approve them and review the change? It keeps HybridOnlineStore's |
9fbd38b to
e4d492f
Compare
HybridOnlineStore.update() applied the first FeatureView and then failed on the second with ValueError: FeatureView must have a 'tribe' tag to use HybridOnlineStore no matter how the views were tagged. The message reports 'tribe' — the fallback, not the configured routing_tag — because config.online_store is no longer the HybridOnlineStoreConfig by the time the second view is read. Two causes: 1. _prepare_repo_conf mutated the caller's RepoConfig. `rconfig = config` is an alias, so both the attribute assignment and the __dict__ writes landed on the caller's object and replaced online_store with the selected backend's config. It also injected `type` into online_store.conf, which belongs to the user's config. 2. update() and teardown() rebound the `config` parameter inside their loops, so the next iteration read routing_tag off the narrowed config even once the mutation was gone. Build the returned mapping from a copy, construct a new dict for the backend conf, and assign the per-backend RepoConfig to a local name in the loops. Behaviour is otherwise unchanged: the returned kwargs are identical to what the mutating version produced. Adds a unit regression test covering both the multi-FeatureView routing and the caller's config staying intact. Both fail on master. Signed-off-by: Jade <retrorca@gmail.com>
Backends act on every FeatureView handed to them, so passing the full keep/delete lists made e.g. SQLite create tables for Redis-routed views, and teardown let each backend drop another backend's tables. - group FeatureViews by routing tag once, call each backend with only its own subset - update() now also reaches a backend that has deletions but no kept views; previously it was never called and its tables were never dropped - teardown() drops the (tribe, type, id(conf)) dedup set: grouping already gives one call per backend, and the old dedup skipped the second view routed to the same backend Signed-off-by: Jade <retrorca@gmail.com>
Per review feedback on the fixtures and test functions. The whole file is covered rather than only the flagged lines, so the signatures stay consistent. No behaviour change; `ruff check` and `ruff format --check` pass on sdk/python/feast and sdk/python/tests. Signed-off-by: Jade <retrorca@gmail.com>
Codecov flagged the new _group_by_routing_tag branches as the only uncovered lines in the patch: nothing exercised an untagged FeatureView or a tag value with no configured backend. - update() raises naming the *configured* routing tag, not the "tribe" default, when a kept view is untagged — that wrong name was the symptom this PR set out to fix - update() skips an untagged view in tables_to_delete instead of raising - update() raises NotImplementedError for a tag no backend claims - teardown() skips such a tag rather than failing _feature_view() takes Optional[str] so a view can be built without the tag. No production change; 9 tests pass, patch coverage is now complete (branch partials on the changed lines go to zero). Signed-off-by: Jade <retrorca@gmail.com>
8aa637b to
03bebdf
Compare
Fixes #6768
What this fixes
HybridOnlineStore.update()applies the firstFeatureViewand then fails on the second, no matter how the views are tagged:The message reports
'tribe'even when the repo config sets a customrouting_tag, because that string is the fallback inGetting the fallback means
config.online_storeis no longer theHybridOnlineStoreConfigby the time the second view is read. In practice this makes the store unusable for any repo with more than oneFeatureView.Root cause
1.
_prepare_repo_confmutated the caller'sRepoConfig.rconfig = configis an alias, not a copy, sorconfig.online_config = ...and thedata = rconfig.__dict__writes all landed on the caller's object — replacingonline_storewith the selected backend's config. It also injectedtypeintoonline_store.conf, which belongs to the user's config and is read again on the next lookup.2.
update()andteardown()rebound theconfigparameter inside their loops. Even with (1) fixed, the next iteration would receive the narrowed config instead of the hybrid one.online_write_batch()andonline_read()rebind as well, but those are single-use per call; fixing (1) is what makes them safe, so they are left as they are to keep the diff small.The change
_prepare_repo_confbuilds its result fromdict(config.__dict__)and constructs a new dict for the backend conf instead of injecting into the caller's. The returned kwargs are identical to what the mutating version produced —online_configandonline_storeare both set to the selected backend's conf, exactly as before — so nothing downstream changes.update()andteardown()assign the per-backendRepoConfigto a localstore_configrather than rebindingconfig.Tests
New unit test at
sdk/python/tests/unit/infra/online_store/test_hybrid_online_store.py:test_update_routes_every_feature_view— two views with a customrouting_tag, one per backend; asserts both backends'update()are called once and the caller'srouting_tagsurvives.test_prepare_repo_conf_does_not_mutate_caller_config— asserts the caller'sonline_storeobject and itsconfdict are untouched.Both fail on
masterand pass with this change:ruff check,ruff format --check, andmypyare clean on both files (the mypy errors that remain in the tree are pre-existing and in other modules).The existing
sdk/python/tests/integration/online_store/test_hybrid_online_store.pycovers the write/read path; I could not run it locally as it needstestcontainers/Docker, but this change does not alter the config those paths receive.