Title: fix: Infer vector width when vector_length is undeclared by haoxu0 · Pull Request #6935 · feast-dev/feast · GitHub
Open Graph Title: fix: Infer vector width when vector_length is undeclared by haoxu0 · Pull Request #6935 · feast-dev/feast
X Title: fix: Infer vector width when vector_length is undeclared by haoxu0 · Pull Request #6935 · feast-dev/feast
Description: Addresses item 3 of #6907 — but not the way the issue proposed, because that way does not work. Why "require vector_length" is off the table The issue suggested requiring vector_length when vector_index=True. I checked the blast radius first: ~29 call sites declare vector_index=True without vector_length, including Feast's own templates: feast/templates/rag/feature_repo/example_repo.py and feast/templates/ray_rag/feature_repo/feature_definitions.py — i.e. feast init -t rag would stop working examples/rag/, examples/rag-docling/, examples/agent_feature_store/, the Milvus and pgvector tutorials four online stores that deliberately fall back to 512: sqlite, qdrant, elasticsearch, mongodb Making it mandatory would break the onboarding path. Not worth it. What this does instead The underlying complaint is still valid: vector_length defaults to 0, and 0 meant skip, so the common case was unvalidated — a correctness check that is off by default. So rather than skipping when it is undeclared, the width of the first non-null row becomes the contract for the rest of the table. An ANN index requires a fixed width, so a ragged vector column is a defect whether or not anyone declared a length. Inferring is strictly better than skipping, and it requires nobody to change a single declaration. case before after vector_length declared enforced enforced (unchanged) undeclared, uniform widths skipped passes undeclared, ragged widths skipped rejected undeclared, fixed_size_list skipped no check needed — uniform by construction undeclared, all-null column skipped no-op, nothing to infer from vector_index=False skipped skipped The gate also moves from vector_length to vector_index, since vector_index is the attribute that actually says "this field is a vector". Error messages distinguish the two sources, so an inferred failure is not mistaken for a declared one: Row 2: Vector length 7 does not match expected 4, inferred from the first row for feature 'embedding' in feature view 'fv'. Testing 11 new tests in test_vector_length_validation.py (32 total), covering both the Arrow and DataFrame paths: ragged rejected, uniform passes, declared still wins over inference, fixed_size_list needs no check, nulls neither infer nor compare, all-null is a no-op, non-sequence still caught, and vector_index=False untouched. Three of them fail against master and pass here. The important check for this PR is that inference does not break the 29 undeclared sites. I diffed failure names across the full unit suite rather than comparing counts, since the suite has flaky members: with this change : 41 failures master : 41 failures only with change : (none) That is also the evidence that none of those sites produce ragged columns in practice. ruff check / ruff format --check clean. mypy unchanged — same 2 pre-existing errors at feature_store.py:2123. Relationship to the other PRs #6909 (merged) — items 1, 2, 4 of #6907 #6934 — item 5, Field.__eq__ this PR — item 3 With this, #6907 can be closed.
Open Graph Description: Addresses item 3 of #6907 — but not the way the issue proposed, because that way does not work. Why "require vector_length" is off the table The issue suggested requiring vector_length wh...
X Description: Addresses item 3 of #6907 — but not the way the issue proposed, because that way does not work. Why "require vector_length" is off the table The issue suggested requiring vector_l...
Opengraph URL: https://github.com/feast-dev/feast/pull/6935
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:6e00b1d8-c469-01b2-1a36-74e62d4b93fe |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EC5A:2D746B:2D99DF:3D69CC:6AFE987F |
| html-safe-nonce | fcbd97d591085f91b89552d7a62d765efd309c25c4202214e435bd4364090064 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzVBOjJENzQ2QjoyRDk5REY6M0Q2OUNDOjZBRkU5ODdGIiwidmlzaXRvcl9pZCI6Ijg4Nzc0NjM2MDE3ODczNDUwMjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d5085752d5860b14e34aaf8a0eccab4364dd07bb168fc12b90cf4e12fde32fb8 |
| hovercard-subject-tag | pull_request:4723034683 |
| 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/6935/files |
| twitter:image | https://avatars.githubusercontent.com/u/20422210?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/20422210?s=400&v=4 |
| og:image:alt | Addresses item 3 of #6907 — but not the way the issue proposed, because that way does not work. Why "require vector_length" is off the table The issue suggested requiring vector_length wh... |
| 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