Skip to content

Commit

Permalink
fix: Verify PlaceHolderValue type before search (milvus-io#31626)
Browse files Browse the repository at this point in the history
See also milvus-io#31625

---------

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia authored Mar 27, 2024
1 parent d88026b commit 655097f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions internal/core/src/query/Plan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ ParsePlaceholderGroup(const Plan* plan,
Assert(plan->tag2field_.count(element.tag_));
auto field_id = plan->tag2field_.at(element.tag_);
auto& field_meta = plan->schema_[field_id];
AssertInfo(static_cast<int>(field_meta.get_data_type()) ==
static_cast<int>(info.type()),
"vector type must be the same");
element.num_of_queries_ = info.values_size();
AssertInfo(element.num_of_queries_ > 0, "must have queries");
if (info.type() ==
Expand Down
10 changes: 8 additions & 2 deletions tests/python_client/testcases/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,10 @@ def metric_type(self, request):
def random_primary_key(self, request):
yield request.param

@pytest.fixture(scope="function", params=["FLOAT_VECTOR", "FLOAT16_VECTOR", "BFLOAT16_VECTOR"])
# skip fp16/bf16 for now, the case need to be modified
# see also https://github.com/milvus-io/milvus/issues/31625
# @pytest.fixture(scope="function", params=["FLOAT_VECTOR", "FLOAT16_VECTOR", "BFLOAT16_VECTOR"])
@pytest.fixture(scope="function", params=["FLOAT_VECTOR"])
def vector_data_type(self, request):
yield request.param

Expand Down Expand Up @@ -10455,7 +10458,10 @@ def metric_type(self, request):
def random_primary_key(self, request):
yield request.param

@pytest.fixture(scope="function", params=["FLOAT_VECTOR", "FLOAT16_VECTOR", "BFLOAT16_VECTOR"])
# skip fp16/bf16 for now, the case need to be modified
# see also https://github.com/milvus-io/milvus/issues/31625
# @pytest.fixture(scope="function", params=["FLOAT_VECTOR", "FLOAT16_VECTOR", "BFLOAT16_VECTOR"])
@pytest.fixture(scope="function", params=["FLOAT_VECTOR"])
def vector_data_type(self, request):
yield request.param

Expand Down

0 comments on commit 655097f

Please sign in to comment.