Title: fix: Answer online requests that carry zero entity rows by Daksha1611 · Pull Request #6820 · feast-dev/feast · GitHub
Open Graph Title: fix: Answer online requests that carry zero entity rows by Daksha1611 · Pull Request #6820 · feast-dev/feast
X Title: fix: Answer online requests that carry zero entity rows by Daksha1611 · Pull Request #6820 · feast-dev/feast
Description: What this PR does / why we need it: Three empty-input shapes reached internal exceptions, and the feature server turned each into an HTTP 500: entity_rows=[] -> IndexError: list index out of range entities={"driver_id": []} -> KeyError: Missing join key values for keys: [] entities={} -> KeyError: 'pop from an empty set' The middle case is a well-formed request: the join key was supplied, it simply holds no values, which is what a caller sends when the upstream query matched nothing that run. Three causes, fixed here: get_online_features built its columnar dict from entity_rows[0] on both the sync and async paths, so an empty list raised before anything else ran. _validate_entity_values ended with set_of_row_lengths.pop(); for a mapping with no columns the set is empty and pop() raised. It now reports zero rows. _get_unique_entities treated a join key present with zero values the same as one never supplied — even though the row-wise conversion immediately below it already returns empty results for that case (if not rowise: return (), (), 0). It now raises only when nothing at all was supplied for the view. That last change is deliberately narrow, so existing behaviour is preserved: a partially supplied key set still proceeds (covered by test_get_unique_entities_missing_join_key_success), and a caller supplying nothing relevant still errors with the same message listing the expected keys (covered by test_get_unique_entities_missing_all_join_keys_error). The error is now MissingJoinKeyValuesException, carrying HTTP 400 so the server reports a client error rather than a 500. It subclasses KeyError as well, since that is what this condition raised before and callers catch it — so this is not a breaking change. Resulting behaviour: join keys supplied but empty → 200 with an empty result and correct feature-name metadata; nothing supplied → 400 naming the missing key. Which issue(s) this PR fixes: Fixes #6819 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 sdk/python/tests/unit/online_store/test_empty_entity_rows.py. Four of its five tests fail on master, reproducing all three symptoms above; the fifth asserts the new exception is still a KeyError and carries 400. Full sdk/python/tests/unit: 2612 passed, 24 skipped. The 6 failures and 28 errors in that run are environmental and present on master too — PySpark worker/driver Python version mismatch, a torch import, MongoDB testcontainers, and a missing CUDA library. ruff check, ruff format --check and mypy are clean on all changed files. Misc An empty response was chosen over a 400 for the empty-but-present case, so batch-scoring callers don't have to special-case "my filter matched nothing". It also lines up with get_historical_features returning an empty frame for a zero-row entity_df. Happy to switch to a 400 if maintainers prefer the stricter reading.
Open Graph Description: What this PR does / why we need it: Three empty-input shapes reached internal exceptions, and the feature server turned each into an HTTP 500: entity_rows=[] -> IndexError: list ind...
X Description: What this PR does / why we need it: Three empty-input shapes reached internal exceptions, and the feature server turned each into an HTTP 500: entity_rows=[] -> IndexError: list...
Opengraph URL: https://github.com/feast-dev/feast/pull/6820
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:9ad61bf1-2f1a-0ebb-8e1d-6d3a4d9d87be |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A820:2A4404:E71F6F:13092E1:6AFE9560 |
| html-safe-nonce | 0ef295cc1674fa00e286065904e1d59c46df539a10c9c446805002c7aeebe86a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODIwOjJBNDQwNDpFNzFGNkY6MTMwOTJFMTo2QUZFOTU2MCIsInZpc2l0b3JfaWQiOiI3NjA0NTM0NzUzODEwNjE3Njk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cac416b3265e529dc4a9a37c7559288d309eb6e495ff8e06a036d594949af240 |
| hovercard-subject-tag | pull_request:4460789483 |
| 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/6820/files |
| twitter:image | https://avatars.githubusercontent.com/u/113719658?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/113719658?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: Three empty-input shapes reached internal exceptions, and the feature server turned each into an HTTP 500: entity_rows=[] -> IndexError: list ind... |
| 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