Title: Online requests with zero entity rows return HTTP 500 instead of an empty result or a 400 · Issue #6819 · feast-dev/feast · GitHub
Open Graph Title: Online requests with zero entity rows return HTTP 500 instead of an empty result or a 400 · Issue #6819 · feast-dev/feast
X Title: Online requests with zero entity rows return HTTP 500 instead of an empty result or a 400 · Issue #6819 · feast-dev/feast
Description: Expected Behavior An online request carrying zero entity rows should be answered, not crash. A caller whose upstream query matched nothing this run sends an empty batch, and a request that genuinely omits a required join key should come ...
Open Graph Description: Expected Behavior An online request carrying zero entity rows should be answered, not crash. A caller whose upstream query matched nothing this run sends an empty batch, and a request that genuinel...
X Description: Expected Behavior An online request carrying zero entity rows should be answered, not crash. A caller whose upstream query matched nothing this run sends an empty batch, and a request that genuinel...
Opengraph URL: https://github.com/feast-dev/feast/issues/6819
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Online requests with zero entity rows return HTTP 500 instead of an empty result or a 400","articleBody":"## Expected Behavior\n\nAn online request carrying zero entity rows should be answered, not crash. A caller\nwhose upstream query matched nothing this run sends an empty batch, and a request that\ngenuinely omits a required join key should come back as a client error (4xx) naming the\nkey.\n\n## Current Behavior\n\nThree related empty-input shapes surface internal exceptions, and the feature server\nturns each into an HTTP 500 with an opaque message:\n\n| Request | Result |\n|---|---|\n| `store.get_online_features(features=[...], entity_rows=[])` | `IndexError: list index out of range` |\n| `POST /get-online-features` with `{\"entities\": {\"driver_id\": []}}` | HTTP 500 — `\"Missing join key values for keys: []. No values provided for keys: ['driver_id']. Provided join_key_values: ['driver_id']\"` |\n| `POST /get-online-features` with `{\"entities\": {}}` | HTTP 500 — `\"'pop from an empty set'\"` |\n\nThe middle one is the worst of the three: the join key *was* supplied, it just has no\nvalues, so this is a well-formed request that should return an empty result.\n\nThe same request shape with a single entity row returns 200.\n\n## Steps to reproduce\n\nAgainst a local `file` + `sqlite` repo:\n\n```python\nfs.get_online_features(features=[\"driver_stats:conv_rate\"], entity_rows=[]).to_dict()\n# IndexError: list index out of range\n```\n\nAnd through the server:\n\n```python\nclient = TestClient(get_app(fs), raise_server_exceptions=False)\n\nclient.post(\"/get-online-features\", json={\n \"features\": [\"driver_stats:conv_rate\"],\n \"entities\": {\"driver_id\": []},\n})\n# 500 \"Missing join key values for keys: []. No values provided for keys: ['driver_id']...\"\n\nclient.post(\"/get-online-features\", json={\n \"features\": [\"driver_stats:conv_rate\"],\n \"entities\": {},\n})\n# 500 \"'pop from an empty set'\"\n```\n\n### Specifications\n\n- Version: `master` @ `5ad5592390febfca60c9d88edf7daccbdd156fd6`\n- Platform: Linux x86_64, Python 3.11.15\n- Subsystem: online serving / feature server\n\n## Possible Solution\n\nThree distinct causes:\n\n* `sdk/python/feast/infra/online_stores/online_store.py:169` and `:453` (the sync and\n async paths) both build the columnar dict with `{k: [] for k in entity_rows[0].keys()}`,\n with no guard for an empty list.\n* `sdk/python/feast/utils.py:554` `_validate_entity_values` ends with\n `set_of_row_lengths.pop()`. For an empty mapping the set is empty and `.pop()` raises\n `KeyError: 'pop from an empty set'`.\n* `sdk/python/feast/utils.py` `_get_unique_entities` treats \"join key present but holding\n zero values\" the same as \"join key never supplied\". The row-wise conversion immediately\n below it already handles zero rows (`if not rowise: return (), (), 0`), so the guard is\n rejecting a case the code beneath it supports.\n\nA reasonable contract, and the one I've implemented in the linked PR:\n\n* join keys supplied but empty → empty response with the correct feature-name metadata,\n consistent with `get_historical_features` returning an empty frame for a zero-row\n `entity_df`;\n* nothing supplied at all → a typed client error carrying HTTP 400 rather than a 500.\n\nI went with an empty response rather than a 400 for the empty-but-present case because\nit keeps batch-scoring callers from having to special-case \"my filter matched nothing\".\nHappy to switch it to a 400 if maintainers prefer the stricter reading — it is a one-line\nchange either way.\n","author":{"url":"https://github.com/Daksha1611","@type":"Person","name":"Daksha1611"},"datePublished":"2026-09-07T06:11:55Z","url":"https://github.com/feast-dev/feast/issues/6819"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:68f73f7c-6904-a897-0fe0-1b4f442f7131 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD24:184DF1:E2222F:1352AFE:6AFE9528 |
| html-safe-nonce | de07de817bf065fb02b8c912c33002cbddd4aaee8b7ca48488a6945785dbfbdc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDI0OjE4NERGMTpFMjIyMkY6MTM1MkFGRTo2QUZFOTUyOCIsInZpc2l0b3JfaWQiOiI1MjkwMjA2MzMyMzI5MDM5MTQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4524e7218537e7f6e33e7affe09cf3b906f64068183c838d6edfdde251d1d95d |
| hovercard-subject-tag | issue:5370751683 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/feast-dev/feast/6819/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c63aa1e43d55d1b4d278ed50c9f545e367db5d5e2c5f2515a542d30189395b7a/feast-dev/feast/issues/6819 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c63aa1e43d55d1b4d278ed50c9f545e367db5d5e2c5f2515a542d30189395b7a/feast-dev/feast/issues/6819 |
| og:image:alt | Expected Behavior An online request carrying zero entity rows should be answered, not crash. A caller whose upstream query matched nothing this run sends an empty batch, and a request that genuinel... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Daksha1611 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width