MOPS-1232 support configurable app_profile_id for online store - #48
Draft
PiotrSierkin-Ki wants to merge 1 commit into
Draft
MOPS-1232 support configurable app_profile_id for online store#48PiotrSierkin-Ki wants to merge 1 commit into
PiotrSierkin-Ki wants to merge 1 commit into
Conversation
Adds an optional app_profile_id to BigtableOnlineStoreConfig, threaded through the sync, async-v1, and async-v2 online read/write paths. Defaults to None so existing deployments keep using Bigtable's default app profile unchanged. Lets downstream workloads route through dedicated Bigtable app profiles (e.g. separate priority/isolation for a lower-priority workload) without forking the online store implementation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Adds an optional
app_profile_idfield toBigtableOnlineStoreConfig, threaded through all four Bigtable data-access paths (sync read, sync write, async v1, async v2). Defaults toNone, which preserves today's behavior exactly — requests continue to use Bigtable's default app profile when unset.This unblocks routing specific workloads (e.g. a lower-priority/isolated consumer) through a dedicated Bigtable app profile — for priority (
PRIORITY_HIGH/PRIORITY_LOW) and per-profile metrics attribution — without forking the online store.Why this is safe — verified against the installed client
Checked against
google-cloud-bigtable==2.31.0(the version this repo already pins) that every parameter this PR adds is a real, existing kwarg on the underlying client — not something invented for this change:Instance.table()already acceptsapp_profile_id:Table.__init__stores it asself._app_profile_id(google/cloud/bigtable/table.py) and it's threaded into the builtReadRowsRequest/MutateRowsRequestattable.py:643,:736,:781,:1151.Async v1 client —
BigtableDataClientAsync.get_table()documents the same parameter:ReadRowsRequesthas a first-classapp_profile_idfield:So this PR is pure plumbing — passing a value Feast already had available (
config.online_store) into parameters the client library has supported all along.References
google_bigtable_app_profileInstance.table()Tests
sdk/python/tests/unit/infra/online_store/test_bigtable.py(new) — mocked-client unit tests: config defaults toNone, and each of the 4 call sites (online_read,online_write_batch,online_read_async,online_read_async_v2) receives the configuredapp_profile_id, parametrized over[None, "test-app-profile"].sdk/python/tests/integration/online_store/test_bigtable_app_profile.py(new) — emulator-backed round trip. Note: the Bigtable emulator has no concept of app profiles (no creation, no routing, no priority enforcement), so it can't validate server-side behavior. To still get a meaningful assertion, the test spies on the realInstance.table()(patch.object(..., side_effect=Instance.table)) to confirm our code actually threads the configured profile into the real client call, rather than only checking that read-after-write succeeds (which would pass even if the profile were silently dropped).tests/integration/feature_repos/universal/online_store/bigtable.py—BigtableOnlineStoreCreatorgained an optionalapp_profile_idkwarg (unset by default), used only by the new integration test above; the existing universal online-store test matrix is unaffected.