Skip to content

Python: fix VectorSearch.search overloads advertising vector_field_name - #14743

Open
alexcastgonz (pcbeingused333) wants to merge 1 commit into
microsoft:mainfrom
pcbeingused333:fix/vector-search-overload-c1783
Open

alexcastgonz (pcbeingused333) wants to merge 1 commit into
microsoft:mainfrom
pcbeingused333:fix/vector-search-overload-c1783

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #14740

Root cause

The two VectorSearch.search() @overloads declared a vector_field_name keyword, but the implementation (and the hybrid/keyword overloads) use vector_property_name. Callers following the advertised signature passed vector_field_name=..., which silently fell into **kwargs and was ignored, so the default vector field was used.

Fix

Rename the parameter and docstrings in both overloads to vector_property_name.

Test

test_search_overloads_match_implementation_parameters inspects the overloads via typing.get_overloads (fails before, passes after).


Disclosure: this change was prepared with the assistance of an AI coding agent (Claude) and submitted by the account owner.

The overloads declared a vector_field_name keyword while the implementation
and the hybrid/keyword overloads use vector_property_name, so type checkers
and IDEs suggested an argument that ends up ignored in **kwargs.

Rename the overload parameter and docstrings, and add a signature test.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the overload parameter-name correction and accompanying regression test.

No open issues 🎉

What changed in this PR

Corrects the advertised VectorSearch.search() signatures to match the existing vector_property_name runtime parameter, addressing the overload mismatch reported in #14740 without changing runtime behavior.

Changes:

  • Renames the parameter and its documentation in both search overloads.
  • Adds a regression test checking overload parameter names against the implementation.
File Description
python/​tests/​unit/​data/​test_vector_search_base.py Adds overload-to-implementation parameter checks.
python/​semantic_kernel/​data/​vector.py Corrects both overload signatures and corresponding docstrings.

Review effort: Balanced

This branch was successfully deployed

1 active deployment
github-app-auth — 1c4499d4 Deployed Nov 7, 2026 by pcbeingused333 via add_label #29624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Bug: search ignores the advertised vector_field_name and searches another vector field

2 participants