From 869502413f32ea70cb39a667e8ab12ebea712055 Mon Sep 17 00:00:00 2001 From: CaiYudong Date: Mon, 10 Feb 2025 11:34:23 +0800 Subject: [PATCH] enhance: add some missing code for Int8Vector Signed-off-by: CaiYudong --- client/go.mod | 4 ++-- client/go.sum | 8 ++++---- client/milvusclient/read_option_test.go | 5 +++++ client/milvusclient/read_options.go | 2 ++ tests/go_client/go.mod | 4 ++-- tests/go_client/go.sum | 8 ++++---- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/client/go.mod b/client/go.mod index 4a50c97f1ae50..fbb139663c920 100644 --- a/client/go.mod +++ b/client/go.mod @@ -6,8 +6,8 @@ require ( github.com/blang/semver/v4 v4.0.0 github.com/cockroachdb/errors v1.9.1 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250102080446-c3ba3d26a90f - github.com/milvus-io/milvus/pkg v0.0.2-0.20250115044500-f5234c3c11a3 + github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250107132849-4099923438e6 + github.com/milvus-io/milvus/pkg v0.0.2-0.20250210024444-82bdf8584c13 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/samber/lo v1.27.0 github.com/stretchr/testify v1.9.0 diff --git a/client/go.sum b/client/go.sum index 70171495c36d1..700b0ebd4b1e2 100644 --- a/client/go.sum +++ b/client/go.sum @@ -318,10 +318,10 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250102080446-c3ba3d26a90f h1:So6RKU5wqP/8EaKogicJP8gZ2SrzzS/JprusBaE3RKc= -github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250102080446-c3ba3d26a90f/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= -github.com/milvus-io/milvus/pkg v0.0.2-0.20250115044500-f5234c3c11a3 h1:WF9BkNk1XjLtwMbaB/cniRBMMNLnqG6e+AUbK8DciHQ= -github.com/milvus-io/milvus/pkg v0.0.2-0.20250115044500-f5234c3c11a3/go.mod h1:nxnHkDFB3jh27nTQJBaC4azAQO8chT03DkmoiZ5086s= +github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250107132849-4099923438e6 h1:IUHMoxffuI2xbtMJJE/XK7kKzavZnN5sMiheIKTDVt8= +github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250107132849-4099923438e6/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= +github.com/milvus-io/milvus/pkg v0.0.2-0.20250210024444-82bdf8584c13 h1:7NqS88d7G8QeAqkLgdIRV5KgwtvuuKzrtilRcTTEDJM= +github.com/milvus-io/milvus/pkg v0.0.2-0.20250210024444-82bdf8584c13/go.mod h1:EstKk4LF1EwsaW0zoFeGnL4U/e/POqGbLiKsnb90DpU= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= diff --git a/client/milvusclient/read_option_test.go b/client/milvusclient/read_option_test.go index 04a061047073a..0ce8af0db4a32 100644 --- a/client/milvusclient/read_option_test.go +++ b/client/milvusclient/read_option_test.go @@ -120,6 +120,11 @@ func (s *SearchOptionSuite) TestPlaceHolder() { input: []entity.Vector{entity.BinaryVector([]byte{})}, expectType: commonpb.PlaceholderType_BinaryVector, }, + { + tag: "int8_vector", + input: []entity.Vector{entity.Int8Vector([]int8{})}, + expectType: commonpb.PlaceholderType_Int8Vector, + }, { tag: "text", input: []entity.Vector{entity.Text("abc")}, diff --git a/client/milvusclient/read_options.go b/client/milvusclient/read_options.go index f378cff215d5b..c7c1cb44eb905 100644 --- a/client/milvusclient/read_options.go +++ b/client/milvusclient/read_options.go @@ -401,6 +401,8 @@ func vector2Placeholder(vectors []entity.Vector) (*commonpb.PlaceholderValue, er placeHolderType = commonpb.PlaceholderType_Float16Vector case entity.SparseEmbedding: placeHolderType = commonpb.PlaceholderType_SparseFloatVector + case entity.Int8Vector: + placeHolderType = commonpb.PlaceholderType_Int8Vector case entity.Text: placeHolderType = commonpb.PlaceholderType_VarChar default: diff --git a/tests/go_client/go.mod b/tests/go_client/go.mod index 29f330bf52d36..f0d2a1a7cfdc4 100644 --- a/tests/go_client/go.mod +++ b/tests/go_client/go.mod @@ -6,7 +6,7 @@ toolchain go1.21.11 require ( github.com/milvus-io/milvus/client/v2 v2.0.0-20241125024034-0b9edb62a92d - github.com/milvus-io/milvus/pkg v0.0.2-0.20250115044500-f5234c3c11a3 + github.com/milvus-io/milvus/pkg v0.0.2-0.20250210024444-82bdf8584c13 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/stretchr/testify v1.9.0 github.com/x448/float16 v0.8.4 @@ -52,7 +52,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250102080446-c3ba3d26a90f // indirect + github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250107132849-4099923438e6 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/opencontainers/runtime-spec v1.0.2 // indirect diff --git a/tests/go_client/go.sum b/tests/go_client/go.sum index 70171495c36d1..700b0ebd4b1e2 100644 --- a/tests/go_client/go.sum +++ b/tests/go_client/go.sum @@ -318,10 +318,10 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250102080446-c3ba3d26a90f h1:So6RKU5wqP/8EaKogicJP8gZ2SrzzS/JprusBaE3RKc= -github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250102080446-c3ba3d26a90f/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= -github.com/milvus-io/milvus/pkg v0.0.2-0.20250115044500-f5234c3c11a3 h1:WF9BkNk1XjLtwMbaB/cniRBMMNLnqG6e+AUbK8DciHQ= -github.com/milvus-io/milvus/pkg v0.0.2-0.20250115044500-f5234c3c11a3/go.mod h1:nxnHkDFB3jh27nTQJBaC4azAQO8chT03DkmoiZ5086s= +github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250107132849-4099923438e6 h1:IUHMoxffuI2xbtMJJE/XK7kKzavZnN5sMiheIKTDVt8= +github.com/milvus-io/milvus-proto/go-api/v2 v2.5.0-beta.0.20250107132849-4099923438e6/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= +github.com/milvus-io/milvus/pkg v0.0.2-0.20250210024444-82bdf8584c13 h1:7NqS88d7G8QeAqkLgdIRV5KgwtvuuKzrtilRcTTEDJM= +github.com/milvus-io/milvus/pkg v0.0.2-0.20250210024444-82bdf8584c13/go.mod h1:EstKk4LF1EwsaW0zoFeGnL4U/e/POqGbLiKsnb90DpU= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=