Title: fix: Preserve an unset aggregation time window across a proto round-trip by Rodrigo-Palma · Pull Request #6859 · feast-dev/feast · GitHub
Open Graph Title: fix: Preserve an unset aggregation time window across a proto round-trip by Rodrigo-Palma · Pull Request #6859 · feast-dev/feast
X Title: fix: Preserve an unset aggregation time window across a proto round-trip by Rodrigo-Palma · Pull Request #6859 · feast-dev/feast
Description: What this PR does / why we need it Aggregation.__init__ types time_window and slide_interval as Optional, and to_proto honours that: it only writes the Duration when the value is not None. from_proto tests the value instead of the presence: time_window = ( timedelta(days=0) if agg_proto.time_window.ToNanoseconds() == 0 else agg_proto.time_window.ToTimedelta() ) An absent Duration also reports ToNanoseconds() == 0, so an aggregation defined without a window comes back as timedelta(0). That difference is load bearing. aggregation_specs_to_agg_ops rejects a windowed aggregation in online serving with: if getattr(agg, "time_window", None) is not None: raise ValueError(time_window_unsupported_error_message) So an on demand feature view written the way the existing tests write it: @on_demand_feature_view(..., aggregations=[Aggregation(column="trips", function="sum")], mode="python") works in process, and then fails on the first get_online_features after feast apply, with "Time window aggregation is not supported in online serving.", even though no window was ever requested. Any registry reaches this, since they all round-trip through the proto. StreamFeatureView runs the same conversion. Aggregation.__eq__ compares both attributes, so a registry diff also sees an unchanged feature view as modified. Fix Read the fields through HasField, which is available because both are google.protobuf.Duration message fields and therefore have presence. Testing Two tests in test_on_demand_feature_view_aggregation.py: a plain round-trip that asserts None survives, and an end to end one that takes an ODFV through to_proto/from_proto and then serves it. Both fail before the change and pass after. ruff check, ruff format and mypy are clean on the touched files.
Open Graph Description: What this PR does / why we need it Aggregation.__init__ types time_window and slide_interval as Optional, and to_proto honours that: it only writes the Duration when the value is not None. from_pro...
X Description: What this PR does / why we need it Aggregation.__init__ types time_window and slide_interval as Optional, and to_proto honours that: it only writes the Duration when the value is not None. from_pro...
Opengraph URL: https://github.com/feast-dev/feast/pull/6859
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:881013d6-c730-3ae7-18b6-7feb353a30e9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BAF8:D8CB1:F34D1D:14CABC3:6AFE988B |
| html-safe-nonce | 9b0648bf8260b0070574d25a9502c9ab68758380ac1fa22921cfefa388322617 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUY4OkQ4Q0IxOkYzNEQxRDoxNENBQkMzOjZBRkU5ODhCIiwidmlzaXRvcl9pZCI6IjE3OTQzMjQxNTI3OTA3MTg2MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8f5a4b4ca07498212bf38e80d343b9ad3c59f56d1c9f4fc3016b1a72f09e0eb0 |
| hovercard-subject-tag | pull_request:4620138293 |
| 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/6859/files |
| twitter:image | https://avatars.githubusercontent.com/u/86628053?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/86628053?s=400&v=4 |
| og:image:alt | What this PR does / why we need it Aggregation.__init__ types time_window and slide_interval as Optional, and to_proto honours that: it only writes the Duration when the value is not None. from_pro... |
| 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