From f7b4d1f8602956881fd54b210aaa81b326384c68 Mon Sep 17 00:00:00 2001 From: Tahiya Salam Date: Wed, 29 Jan 2025 09:18:04 -0500 Subject: [PATCH] Remove TagsByFilter in preparation of deprecating API --- app/data_client.go | 12 ------------ app/data_client_test.go | 14 -------------- testutils/inject/data_service_client.go | 10 ---------- 3 files changed, 36 deletions(-) diff --git a/app/data_client.go b/app/data_client.go index 12a470d7f12..437dfb0a499 100644 --- a/app/data_client.go +++ b/app/data_client.go @@ -668,18 +668,6 @@ func (d *DataClient) RemoveTagsFromBinaryDataByFilter(ctx context.Context, return int(resp.DeletedCount), nil } -// TagsByFilter retrieves all unique tags associated with the data that match the specified filter. -// It returns the list of these unique tags. If no filter is given, all data tags are returned. -func (d *DataClient) TagsByFilter(ctx context.Context, filter *Filter) ([]string, error) { - resp, err := d.dataClient.TagsByFilter(ctx, &pb.TagsByFilterRequest{ - Filter: filterToProto(filter), - }) - if err != nil { - return nil, err - } - return resp.Tags, nil -} - // AddBoundingBoxToImageByID adds a bounding box to an image with the specified ID, // using the provided label and position in normalized coordinates. // All normalized coordinates (xMin, yMin, xMax, yMax) must be float values in the range [0, 1]. diff --git a/app/data_client_test.go b/app/data_client_test.go index b5fa0e4b42f..c3c996b95ae 100644 --- a/app/data_client_test.go +++ b/app/data_client_test.go @@ -564,20 +564,6 @@ func TestDataClient(t *testing.T) { test.That(t, resp, test.ShouldEqual, count) }) - t.Run("TagsByFilter", func(t *testing.T) { - grpcClient.TagsByFilterFunc = func(ctx context.Context, in *pb.TagsByFilterRequest, - opts ...grpc.CallOption, - ) (*pb.TagsByFilterResponse, error) { - test.That(t, in.Filter, test.ShouldResemble, pbFilter) - return &pb.TagsByFilterResponse{ - Tags: tags, - }, nil - } - resp, err := client.TagsByFilter(context.Background(), &filter) - test.That(t, err, test.ShouldBeNil) - test.That(t, resp, test.ShouldResemble, tags) - }) - t.Run("AddBoundingBoxToImageByID", func(t *testing.T) { grpcClient.AddBoundingBoxToImageByIDFunc = func(ctx context.Context, in *pb.AddBoundingBoxToImageByIDRequest, diff --git a/testutils/inject/data_service_client.go b/testutils/inject/data_service_client.go index 9344400ee0f..f3bc6d4bb92 100644 --- a/testutils/inject/data_service_client.go +++ b/testutils/inject/data_service_client.go @@ -220,16 +220,6 @@ func (client *DataServiceClient) RemoveTagsFromBinaryDataByFilter(ctx context.Co return client.RemoveTagsFromBinaryDataByFilterFunc(ctx, in, opts...) } -// TagsByFilter calls the injected TagsByFilter or the real version. -func (client *DataServiceClient) TagsByFilter(ctx context.Context, in *datapb.TagsByFilterRequest, - opts ...grpc.CallOption, -) (*datapb.TagsByFilterResponse, error) { - if client.TagsByFilterFunc == nil { - return client.DataServiceClient.TagsByFilter(ctx, in, opts...) - } - return client.TagsByFilterFunc(ctx, in, opts...) -} - // AddBoundingBoxToImageByID calls the injected AddBoundingBoxToImageByID or the real version. func (client *DataServiceClient) AddBoundingBoxToImageByID(ctx context.Context, in *datapb.AddBoundingBoxToImageByIDRequest, opts ...grpc.CallOption,