Skip to content

fix: Use matching proto class per feature view list in SqliteOnlineStore.plan() - #6659

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
casaar97:fix/plan-stream-feature-view-typecheck
Jul 30, 2026
Merged

fix: Use matching proto class per feature view list in SqliteOnlineStore.plan()#6659
ntkathole merged 1 commit into
feast-dev:masterfrom
casaar97:fix/plan-stream-feature-view-typecheck

Conversation

@casaar97

Copy link
Copy Markdown
Contributor

What this PR does / why we need it

Fixes #6658.

SqliteOnlineStore.plan() applies FeatureView.from_proto() uniformly to both desired_registry_proto.feature_views and desired_registry_proto.stream_feature_views. FeatureView is @typechecked, and from_proto's parameter is annotated as FeatureViewProto, so passing a StreamFeatureViewProto (from the stream_feature_views list) raises typeguard.TypeCheckError at runtime -- plan() (and therefore feast plan) fails outright on any repo with at least one StreamFeatureView registered.

This uses the matching class per list instead:

views = [
    FeatureView.from_proto(view) for view in desired_registry_proto.feature_views
] + [
    StreamFeatureView.from_proto(view)
    for view in desired_registry_proto.stream_feature_views
]

_table_id() / compute_table_id() / compute_versioned_name() only touch .name, .projection, and .current_version_number (the latter two via getattr with defaults), so a StreamFeatureView instance works the same as a FeatureView instance there -- no other change needed.

We ran into this adding plan()/InfraObject support to a custom online store and initially copied this exact pattern from sqlite.py as the only in-tree reference implementation of plan().

Which issue(s) this PR fixes

Fixes #6658

Does this PR introduce a user-facing change?

Fixed `feast plan` raising a typeguard.TypeCheckError for any repo with a registered StreamFeatureView.

Test plan

  • Added sdk/python/tests/unit/infra/online_store/test_sqlite_plan.py with two cases: a registry with only a StreamFeatureView, and one with a batch FeatureView and a StreamFeatureView together.
  • Confirmed both fail with the exact traceback from sqlite.py's OnlineStore.plan() raises typeguard.TypeCheckError for stream feature views #6658 on master before this change, and pass after.
  • Ran the full sdk/python/tests/unit/infra/online_store/ directory (206 tests) -- no regressions.
  • ruff check and ruff format --check pass on the changed files.

@casaar97
casaar97 requested a review from a team as a code owner July 29, 2026 12:28
@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.99%. Comparing base (51ce982) to head (d972891).
⚠️ Report is 1 commits behind head on master.
❗ 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    #6659      +/-   ##
==========================================
+ Coverage   45.93%   45.99%   +0.05%     
==========================================
  Files         414      414              
  Lines       50006    50037      +31     
  Branches     7147     7147              
==========================================
+ Hits        22972    23014      +42     
+ Misses      25423    25412      -11     
  Partials     1611     1611              
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 47.26% <100.00%> (+0.05%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/infra/online_stores/sqlite.py 60.04% <100.00%> (+1.41%) ⬆️

... 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 51ce982...d972891. 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.

@casaar97
casaar97 force-pushed the fix/plan-stream-feature-view-typecheck branch from 02e0617 to 47550c8 Compare July 29, 2026 12:34
@casaar97 casaar97 changed the title fix: use matching proto class per feature view list in SqliteOnlineStore.plan() fix: Use matching proto class per feature view list in SqliteOnlineStore.plan() Jul 29, 2026
@casaar97
casaar97 force-pushed the fix/plan-stream-feature-view-typecheck branch from 47550c8 to 86cf676 Compare July 29, 2026 12:35
@casaar97

Copy link
Copy Markdown
Contributor Author

The `unit-test-go` failure looks unrelated to this change (only Python files are touched here): `open .../go/internal/test/feature_repo/data/registry.db: no such file or directory` in `TestNewFeatureStore`. That same job passed on the base commit this branch is built from (104ad10), so it looks like environmental flakiness in that job rather than something introduced by this PR. Happy to look further if it's actually related -- let me know.

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the matching class for each proto list fixes the typeguard failure while preserving the table-ID path, and the new tests cover stream-only and mixed registries. I found no blocking issue in the remote diff.

ntkathole pushed a commit that referenced this pull request Jul 30, 2026
DynamoDBOnlineStore has no plan() override, so it inherits
OnlineStore.plan()'s no-op default: `feast plan` never reports any
DynamoDB infrastructure changes, unlike SqliteOnlineStore and
MilvusOnlineStore which both implement it.

Adds DynamoDBTable (InfraObject) and DynamoDBOnlineStore.plan(), using
the InfraObject proto's CustomInfra field (protos/feast/core/InfraObject.proto),
which exists specifically so online stores can add InfraObject support
without changes to the core proto -- no other in-tree store uses it yet.

Note this only affects `feast plan`'s reporting: `feast apply`'s
diff-based path (FeatureStore._should_use_plan(), which would call
InfraObject.update()/teardown()) is gated to the local/sqlite provider
only, so DynamoDBOnlineStore.update()/teardown() -- which already
perform the real table creation/deletion -- are unaffected.

Uses the corrected feature-view-list pattern (see #6658 / #6659):
FeatureView.from_proto() and StreamFeatureView.from_proto() applied to
their respective proto lists, not one applied to both.

Signed-off-by: Carlos Sánchez <carlos.sancheza@cabify.com>
…ore.plan()

FeatureView.from_proto() was applied uniformly to both feature_views and
stream_feature_views. FeatureView is @TypeChecked and its from_proto()
parameter is annotated as FeatureViewProto, so passing a
StreamFeatureViewProto raises typeguard.TypeCheckError at runtime.

Use StreamFeatureView.from_proto() for the stream_feature_views list
instead, matching the actual proto type of each entry.

Fixes feast-dev#6658

Signed-off-by: Carlos Sánchez <infsaarc@gmail.com>
@ntkathole
ntkathole force-pushed the fix/plan-stream-feature-view-typecheck branch from 86cf676 to d972891 Compare July 30, 2026 05:04
@ntkathole
ntkathole merged commit adb8c1c into feast-dev:master Jul 30, 2026
20 of 22 checks passed
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.

sqlite.py's OnlineStore.plan() raises typeguard.TypeCheckError for stream feature views

4 participants