infiniflow / infiniflow/infinity

match_dense crashes on non-string knn_params values (embedded + thrift SDKs)

Open Beginner friendly
#3,484 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4.7k
Forks
445
Avg merge
2d 2h
Merged PRs (30d)
7

Description

What happened?

match_dense lowercases every knn_params value assuming it is a string, so a natural call with a numeric option crashes:

table.match_dense("v", [1.0, 2.0], "float", "l2", 5, {"ef": 200})
# AttributeError: 'int' object has no attribute 'lower'

This affects three call sites: the embedded SDK's match_dense, the thrift SDK's match_dense, and the thrift SDK's _handle_fde_match_dense. Every other match_* method formats option values without assuming str, and the HTTP SDK passes them through untouched.

Reproduced on current main (eca7266) for both SDKs.

Expected behavior

Non-string option values are accepted and stringified, so {"ef": 200} behaves the same as {"ef": "200"}.

Versions
  • infinity, current main (eca7266)
  • python/infinity_embedded/local_infinity/query_builder.py, python/infinity_sdk/infinity/remote_thrift/query_builder.py

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in python/infinity_embedded/local_infinity/query_builder.py and python/infinity_sdk/infinity/remote_thrift/query_builder.py, examining match_dense in both SDKs and the thrift _handle_fde_match_dense entry point. Reproduce the issue with a numeric ef value, then verify that numeric and string option values behave equivalently across all three call sites.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.