Skip to content

fix: remove redundant Python-side vector index type validation in create_index#297

Merged
zhourrr merged 3 commits intoalibaba:mainfrom
songqing:fix/bug1-create-index-isinstance
Apr 14, 2026
Merged

fix: remove redundant Python-side vector index type validation in create_index#297
zhourrr merged 3 commits intoalibaba:mainfrom
songqing:fix/bug1-create-index-isinstance

Conversation

@songqing
Copy link
Copy Markdown
Contributor

@songqing songqing commented Apr 1, 2026

The original check used in operator to validate whether an index param
instance belongs to vector index types, which is always False since it
compares an instance against classes. Rather than fixing it with
isinstance, remove the entire Python-side validation and delegate type
checking to the C++ core, which already handles it properly and avoids
the risk of the Python type list falling out of sync.

@songqing songqing requested a review from Cuiyus as a code owner April 1, 2026 03:56
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@songqing songqing changed the title fix: correct vector index type check from to fix: correct vector index type check from in to isinstance Apr 1, 2026
@zhourrr zhourrr force-pushed the fix/bug1-create-index-isinstance branch from 7aa5f08 to 0820ab8 Compare April 14, 2026 03:05
Comment thread python/zvec/model/collection.py Outdated
@songqing songqing force-pushed the fix/bug1-create-index-isinstance branch from 0820ab8 to f57a80c Compare April 14, 2026 03:19
@songqing songqing changed the title fix: correct vector index type check from in to isinstance fix: remove redundant Python-side vector index type validation in create_index Apr 14, 2026
@zhourrr zhourrr force-pushed the fix/bug1-create-index-isinstance branch from 8d3fb0e to 80d7a38 Compare April 14, 2026 11:02
@zhourrr zhourrr merged commit 56ff00b into alibaba:main Apr 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants