Skip to content

Feat: local template odfv write - #6892

Open
ryota717 wants to merge 5 commits into
feast-dev:masterfrom
ryota717:feat/local-template-odfv-write
Open

ryota717 wants to merge 5 commits into
feast-dev:masterfrom
ryota717:feat/local-template-odfv-write

Conversation

@ryota717

Copy link
Copy Markdown

What this PR does / why we need it

Part of #5478 (item 1: extend the driver / default feast init template).

The default template only demonstrated read-time, Pandas-mode on demand feature views.
This PR extends it so that feast init showcases the other transformation options Feast supports:

  • transformed_conv_rate_python: the same transformation as transformed_conv_rate, written in
    native Python mode (mode="python"), so both modes are shown side by side.
  • transformed_conv_rate_on_write: an ODFV with write_to_online_store=True. Its transformation
    runs during materialize / write_to_online_store instead of on every read.
    test_workflow.py reads the materialized values, then writes a raw row and reads the transformed
    values back.

While doing this I found that feast apply on the local provider (which goes through
FeatureStore.plan() → SqliteOnlineStore.plan(), not FeatureStore.apply()) never created the
sqlite table for ODFVs with write_to_online_store=True, so materialize failed with
sqlite3.OperationalError: no such table. The second commit fixes SqliteOnlineStore.plan() to
mirror what update() already does, with unit tests.

test_repo_init now also asserts that the on-write features can be read after
feast apply && feast materialize, covering the CLI path end to end. The quickstart and template
README are updated to match.

Items 2 (RAG, #5946) and 3 (recommendation template, #6078) of #5478 are handled separately.

Which issue(s) this PR fixes

Part of #5478

Misc

Commits are split so they can be reviewed independently:

  1. feat: native Python mode ODFV in the template
  2. fix: sqlite plan() creates tables for write ODFVs
  3. feat: transform-on-write ODFV in the template
  4. test: test_repo_init verifies on-write features
  5. docs: quickstart + template README

…late

The default template already demonstrates a Pandas mode on demand feature
view. Add transformed_conv_rate_python, the same transformation written
in native Python mode (mode="python"), so that feast init shows both
transformation modes side by side, and fetch its features in
test_workflow.py during both historical and online retrieval.

Part of feast-dev#5478

Signed-off-by: ryota717 <ryota.nishijima@fout.jp>
…nline_store

feast apply on the local provider with the sqlite online store goes
through FeatureStore.plan() / _apply_diffs() rather than
FeatureStore.apply(). SqliteOnlineStore.plan() only produced tables for
feature views, stream feature views and label views, so an on demand
feature view with write_to_online_store=True was registered without a
backing table and the subsequent materialize / write_to_online_store
failed with 'sqlite3.OperationalError: no such table'.

Include such on demand feature views in plan(), mirroring what
update() already does for the non-plan apply path, and add unit tests.

Part of feast-dev#5478

Signed-off-by: ryota717 <ryota.nishijima@fout.jp>
…late

Add transformed_conv_rate_on_write, an on demand feature view with
write_to_online_store=True that derives conv_rate_x_acc_rate and
expected_daily_conversions from driver_hourly_stats. Unlike the existing
on demand feature views, its transformation runs when data is written to
the online store (materialize / write_to_online_store) instead of on
every read.

test_workflow.py now shows the materialized values after
materialize_incremental, then writes a raw row through
write_to_online_store and reads the transformed values back.

Part of feast-dev#5478

Signed-off-by: ryota717 <ryota.nishijima@fout.jp>
…l template

Extend test_repo_init so that, after feast apply and feast materialize on
a freshly initialized repo, the features of the write_to_online_store on
demand feature view can be read back from the online store. This covers
the full CLI path (plan-based apply on the local provider) end to end.

Part of feast-dev#5478

Signed-off-by: ryota717 <ryota.nishijima@fout.jp>
Update the quickstart to include transformed_conv_rate_python and
transformed_conv_rate_on_write in the feature_definitions.py listing and
in the feast apply / materialize outputs, and add a step contrasting
read-time (Pandas / native Python) and write-time transformations.
Also list the on demand feature views in the template README.

Part of feast-dev#5478

Signed-off-by: ryota717 <ryota.nishijima@fout.jp>
@ryota717
ryota717 marked this pull request as ready for review September 29, 2026 10:35
@ryota717
ryota717 requested a review from a team as a code owner September 29, 2026 10:35

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant