Title: fix: Compare aggregations, mode and tiling in StreamFeatureView equality by vidigoat · Pull Request #7034 · feast-dev/feast · GitHub
Open Graph Title: fix: Compare aggregations, mode and tiling in StreamFeatureView equality by vidigoat · Pull Request #7034 · feast-dev/feast
X Title: fix: Compare aggregations, mode and tiling in StreamFeatureView equality by vidigoat · Pull Request #7034 · feast-dev/feast
Description: What this PR does / why we need it: StreamFeatureView.__eq__ returns early when neither view has a udf: if not self.udf: return not other.udf so for UDF-less stream feature views (the common case for aggregation-only views) mode, timestamp_field, udf_string and aggregations are never compared. enable_tiling and tiling_hop_size are not compared at all, although both are serialized to the proto. As a result, two stream feature views with different aggregations compare equal: a = StreamFeatureView(..., aggregations=[Aggregation(column="f", function="sum", time_window=timedelta(hours=1))]) b = StreamFeatureView(..., aggregations=[Aggregation(column="f", function="max", time_window=timedelta(days=7))]) a == b # True on master a.to_proto() == b.to_proto() # False The SQL registry relies on this equality: _apply_object skips the write when existing_obj == obj, and apply_feature_view uses != to raise FeatureViewPinConflict when a pinned version is combined with a modified definition. On current master those paths happen to still work, because the registry copy of a stream feature view lists the join key in features (fixed in #7033) and that difference makes FeatureView.__eq__ return False. With #7033 applied and without this change, I reproduced end to end with a SQLite-backed SQL registry that: re-applying the view with aggregations changed from sum/1h to max/7d is silently skipped (the registry keeps sum/1h), and pinning version="v0" while also changing the aggregations does not raise FeatureViewPinConflict. So this should land before (or together with) #7033. The fix compares these fields regardless of whether a UDF is set, and adds enable_tiling and tiling_hop_size. mode and udf_string are compared in normalized form (mode_to_string(...), and None treated as ""), matching how to_proto() writes them. Otherwise a view and its from_proto(to_proto(...)) copy would compare unequal, which would make every apply look like a change and create extra version snapshots. Which issue(s) this PR fixes: No existing issue; found while working on #7033. I searched open and closed issues and PRs for a duplicate. 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 test_stream_feature_view_equality_with_udf covers the UDF branches (only one view has a udf, or both have different udfs). New parametrized test test_stream_feature_view_equality_without_udf (aggregations, mode, timestamp_field, enable_tiling, tiling_hop_size): all 5 cases fail on master and pass with this change; the existing round-trip test test_stream_feature_view_initialization_with_optional_fields_omitted still passes thanks to the normalization above. Manual end-to-end check with a SQLite-backed SQL registry, both with and without #7033 applied: changed aggregations are written, the pin conflict is raised, and re-applying an unchanged view twice creates no new version snapshot. ruff check, ruff format --check and mypy feast pass. Misc Developed with Claude Code (AI) on my behalf. 🤖 Generated with Claude Code
Open Graph Description: What this PR does / why we need it: StreamFeatureView.__eq__ returns early when neither view has a udf: if not self.udf: return not other.udf so for UDF-less stream feature views (the common ca...
X Description: What this PR does / why we need it: StreamFeatureView.__eq__ returns early when neither view has a udf: if not self.udf: return not other.udf so for UDF-less stream feature views (the common ca...
Opengraph URL: https://github.com/feast-dev/feast/pull/7034
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:e4bcdaef-a076-ddb0-4660-decedf805dd0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D4BA:1EECAE:E9BAD6:13F0821:6AFE9568 |
| html-safe-nonce | bb4a4218f75c31d15231c7a44ef2f8316f7acd1509923a8d356b97c5f0c2d8fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEJBOjFFRUNBRTpFOUJBRDY6MTNGMDgyMTo2QUZFOTU2OCIsInZpc2l0b3JfaWQiOiI4NDI4NjMyNDE1NDc5NDM2NjQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cb70c1308917bb071056beea1ac0df3e7fbb256ab7177c2ed289624a8bcec0ec |
| hovercard-subject-tag | pull_request:4907650725 |
| 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/7034/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.__eq__ returns early when neither view has a udf: if not self.udf: return not other.udf so for UDF-less stream feature views (the common ca... |
| 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