Title: fix: Keep entity columns out of StreamFeatureView proto features by vidigoat · Pull Request #7033 · feast-dev/feast · GitHub
Open Graph Title: fix: Keep entity columns out of StreamFeatureView proto features by vidigoat · Pull Request #7033 · feast-dev/feast
X Title: fix: Keep entity columns out of StreamFeatureView proto features by vidigoat · Pull Request #7033 · feast-dev/feast
Description: What this PR does / why we need it: StreamFeatureView.to_proto() serializes spec.features from self.schema, and schema includes the entity (join key) columns. FeatureView.to_proto_spec() uses self.features, so every other feature view type keeps join keys only in spec.entity_columns. Because of this mismatch, a stream feature view loaded back from the registry lists its join key as a feature. Repro with the local provider (file offline store, SQLite online store): driver = Entity(name="driver", join_keys=["driver_id"], value_type=ValueType.INT64) src = FileSource(name="src", path=path, timestamp_field="event_timestamp") push = PushSource(name="push", batch_source=src) sfv = StreamFeatureView( name="driver_sfv", entities=[driver], ttl=timedelta(days=1), schema=[Field(name="driver_id", dtype=Int64), Field(name="conv_rate", dtype=Float32)], source=push, timestamp_field="event_timestamp", ) store.apply([driver, src, push, sfv]) [f.name for f in sfv.features] # ['conv_rate'] [f.name for f in store.get_stream_feature_view("driver_sfv").features] # ['conv_rate', 'driver_id'] svc = FeatureService(name="svc", features=[store.get_stream_feature_view("driver_sfv")]) store.apply([svc]) store.get_historical_features(entity_df=entity_df, features=svc) # ValueError: The column label 'driver_id' is not unique. The same spec.features field is read by the Go feature server (NewFeatureViewFromStreamFeatureViewProto) and the UI, so they also see the join key as a feature. This PR serializes self.features instead of self.schema, the same as FeatureView.to_proto_spec(). from_proto already restores entity_columns from spec.entity_columns, so nothing is lost. With the change, the registry copy above has features ['conv_rate'] and the historical retrieval returns the expected frame. A registry written by an earlier version keeps the extra column until the next feast apply. That apply reports the stream feature view as updated and rewrites spec.features. I checked this locally: apply on master, then re-apply with this change. If you would rather also filter entity columns out on the read side for registries that are never re-applied, I can add that here. Merge order: please merge #7034 first (or together with this). Today the extra join key in the registry copy happens to make StreamFeatureView.__eq__ return False; once this PR removes it, the existing __eq__ short-circuit for UDF-less views makes the SQL registry skip writes when only aggregations change. #7034 fixes that equality. Which issue(s) this PR fixes: No existing issue. I found this while checking feature view proto round-trips, and searched open and closed issues and PRs for a duplicate before opening this. Checks I've made sure the tests are passing. My commits are signed off (git commit -s) My PR title follows conventional commits format Testing Strategy Unit tests Integration tests Manual tests Testing is not required for this change New test test_stream_feature_view_serialization_excludes_entity_columns_from_features in sdk/python/tests/unit/test_stream_feature_view.py defines the join key in schema. It checks that spec.features and spec.entity_columns are disjoint and that from_proto(to_proto(sfv)) == sfv. It fails on master (['dummy_field', 'driver_id'] == ['dummy_field']) and passes with this change. Manual test: the repro above, end to end, with the local provider. Misc Developed with Claude Code (AI) under my direction; the new unit test fails on master and passes with this change.
Open Graph Description: What this PR does / why we need it: StreamFeatureView.to_proto() serializes spec.features from self.schema, and schema includes the entity (join key) columns. FeatureView.to_proto_spec() uses self....
X Description: What this PR does / why we need it: StreamFeatureView.to_proto() serializes spec.features from self.schema, and schema includes the entity (join key) columns. FeatureView.to_proto_spec() uses self....
Opengraph URL: https://github.com/feast-dev/feast/pull/7033
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:db258d2b-c617-c18a-ead5-68d3b5fe1a95 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 97AE:247D07:DFCB25:1323168:6AFE9261 |
| html-safe-nonce | 27cbe15c8d11734e0fd2f38ed2d7bab16ac880310f290fe9b757ab3628ddf4f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0FFOjI0N0QwNzpERkNCMjU6MTMyMzE2ODo2QUZFOTI2MSIsInZpc2l0b3JfaWQiOiI4NjA2MDg1OTYwMDQ1NTk3MjgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fb19f43f8a794351746782a09e4c62ca2eee7cd0a0a9ca837269cc66d390a800 |
| hovercard-subject-tag | pull_request:4907397013 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/7033/files |
| twitter:image | https://avatars.githubusercontent.com/u/219086731?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/219086731?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: StreamFeatureView.to_proto() serializes spec.features from self.schema, and schema includes the entity (join key) columns. FeatureView.to_proto_spec() uses self.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width