Title: fix: Bound Arrow Flight batch size in the offline server by dbbvitor · Pull Request #6896 · feast-dev/feast · GitHub
Open Graph Title: fix: Bound Arrow Flight batch size in the offline server by dbbvitor · Pull Request #6896 · feast-dev/feast
X Title: fix: Bound Arrow Flight batch size in the offline server by dbbvitor · Pull Request #6896 · feast-dev/feast
Description: What this PR does / why we need it: The offline server's do_get() and do_exchange() Flight handlers each returned a single, unbounded Arrow Table/RecordBatch to the client. Once a result approaches Arrow IPC's per-batch limit, sending it raises: ArrowInvalid: Cannot send record batches exceeding 2GiB yet and the whole request fails instead of degrading gracefully. This adds two module-level helpers in offline_server.py: _split_oversized(batch) recursively halves any RecordBatch whose IPC-encoded size exceeds _MAX_BATCH_BYTES (1.5GB, comfortably under the 2GiB cap). It stops recursing at a single row and yields it as-is, so Flight still raises its own clear error for a genuinely oversized row instead of looping forever. _bounded_reader(data) accepts either a pa.Table or a pa.RecordBatchReader and re-batches it through _split_oversized. Both read paths are routed through _bounded_reader: do_get returns fl.RecordBatchStream(_bounded_reader(table)) instead of streaming the raw table directly. do_exchange (the newer HPA-safe single-stream read path added in bae07fc4c) now writes batches in a loop over the bounded reader instead of one writer.write_table(table) call, it was still writing one unbounded table and needed the same fix as do_get. Which issue(s) this PR fixes: Part of #6863 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 New/updated unit tests in sdk/python/tests/unit/test_offline_server.py cover _split_oversized/_bounded_reader directly (oversized splitting, exact-cap boundary, single-oversized-row pass-through, empty batch) and both do_get and do_exchange routing through the bounded reader. The two existing do_exchange unit tests were updated from asserting write_table to asserting the reassembled write_batch calls. Quality bar for this PR: diff-cover against upstream/master: 100% (17/17 changed lines). cosmic-ray mutation testing scoped to the diff (offline_server.py, filtered to lines changed vs upstream/master): 35 mutants generated on the diff, 35 killed, 0 survivors, 0 timeouts, all worker outcomes NORMAL/SKIPPED. One initial survivor (// -> / in the halving arithmetic) was closed with an added test, since a real pyarrow.RecordBatch.slice() silently truncates a float length/offset to the same int and can't otherwise distinguish the two operators. sdk/python/tests/integration/offline_server/test_offline_server.py -v --integration passes locally (4/4) against the real Flight client/server round trip.
Open Graph Description: What this PR does / why we need it: The offline server's do_get() and do_exchange() Flight handlers each returned a single, unbounded Arrow Table/RecordBatch to the client. Once a result approa...
X Description: What this PR does / why we need it: The offline server's do_get() and do_exchange() Flight handlers each returned a single, unbounded Arrow Table/RecordBatch to the client. Once a result ap...
Opengraph URL: https://github.com/feast-dev/feast/pull/6896
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:07fdaa82-0335-17ec-f3cd-13016b099d2e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9B60:262F52:1010631:150AFAF:6AFE98EE |
| html-safe-nonce | 5b2ad4e49c87bb6c19002ffe73795f5c18b757d8de229d50ce9dddcb046f0846 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjYwOjI2MkY1MjoxMDEwNjMxOjE1MEFGQUY6NkFGRTk4RUUiLCJ2aXNpdG9yX2lkIjoiMzIxMjIxNTcwMTg1NDkxODg5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9ef9c41b66d86d040c29d892a7e52e998b69c9c0439fcb0fc911e06aa93b6413 |
| hovercard-subject-tag | pull_request:4682350629 |
| 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/6896/files |
| twitter:image | https://avatars.githubusercontent.com/u/37416518?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/37416518?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: The offline server's do_get() and do_exchange() Flight handlers each returned a single, unbounded Arrow Table/RecordBatch to the client. Once a result approa... |
| 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 | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width