Skip to content

Conversation

@corradopignato
Copy link

Motivation and Context

calls to VectorizedQuery / VectorizableTextQuery pass k_nearest_neighbors, which is not a recognized attribute of the azure-search-documents SDK. The correct attribute is k.

This causes warnings such as:
k_nearest_neighbors is not a known attribute of class and will be ignored

Description

In the function _semantic_search in _search_provider.py, replace every occurrence of k_nearest_neighbors with k (used by VectorizableTextQuery / VectorizedQuery) to match the azure-search-documents SDK.

Copilot AI review requested due to automatic review settings January 21, 2026 16:37
@github-actions github-actions bot changed the title Fix: use k instead of k_nearest_neighbors in Azure Search vector … Python: Fix: use k instead of k_nearest_neighbors in Azure Search vector … Jan 21, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes incorrect parameter naming in Azure AI Search vector query calls that was causing SDK warnings.

Changes:

  • Replaced k_nearest_neighbors parameter with k in VectorizableTextQuery and VectorizedQuery instantiations to align with the azure-search-documents SDK

@corradopignato corradopignato force-pushed the fix/azure-search-vector-k-param branch from 6419e0b to 8e442f5 Compare January 21, 2026 17:47
@eavanvalkenburg
Copy link
Member

@farzad528 can you doublecheck this?

@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL17473271284% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
3186 213 💤 0 ❌ 0 🔥 1m 4s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants