Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove TagsByFilter in preparation of deprecating API #4755

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/data_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
14 changes: 0 additions & 14 deletions app/data_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 0 additions & 10 deletions testutils/inject/data_service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading