Skip to content

Commit aeb384a

Browse files
Google APIscopybara-github
authored andcommitted
feat: add ListSavedQueries rpc to aiplatform v1beta1 dataset_service.proto
feat: add saved_query.proto to aiplatform v1beta1 feat: add saved_query_id to InputDataConfig in aiplatform v1beta1 training_pipeline.proto PiperOrigin-RevId: 456872207
1 parent fdca4dd commit aeb384a

4 files changed

Lines changed: 146 additions & 0 deletions

File tree

google/cloud/aiplatform/v1beta1/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ proto_library(
7979
"pipeline_service.proto",
8080
"pipeline_state.proto",
8181
"prediction_service.proto",
82+
"saved_query.proto",
8283
"specialist_pool.proto",
8384
"specialist_pool_service.proto",
8485
"study.proto",

google/cloud/aiplatform/v1beta1/dataset_service.proto

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import "google/cloud/aiplatform/v1beta1/annotation_spec.proto";
2525
import "google/cloud/aiplatform/v1beta1/data_item.proto";
2626
import "google/cloud/aiplatform/v1beta1/dataset.proto";
2727
import "google/cloud/aiplatform/v1beta1/operation.proto";
28+
import "google/cloud/aiplatform/v1beta1/saved_query.proto";
2829
import "google/longrunning/operations.proto";
2930
import "google/protobuf/field_mask.proto";
3031

@@ -126,6 +127,14 @@ service DatasetService {
126127
option (google.api.method_signature) = "parent";
127128
}
128129

130+
// Lists SavedQueries in a Dataset.
131+
rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse) {
132+
option (google.api.http) = {
133+
get: "/v1beta1/{parent=projects/*/locations/*/datasets/*}/savedQueries"
134+
};
135+
option (google.api.method_signature) = "parent";
136+
}
137+
129138
// Gets an AnnotationSpec.
130139
rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) {
131140
option (google.api.http) = {
@@ -357,6 +366,44 @@ message ListDataItemsResponse {
357366
string next_page_token = 2;
358367
}
359368

369+
// Request message for [DatasetService.ListSavedQueries][google.cloud.aiplatform.v1beta1.DatasetService.ListSavedQueries].
370+
message ListSavedQueriesRequest {
371+
// Required. The resource name of the Dataset to list SavedQueries from.
372+
// Format:
373+
// `projects/{project}/locations/{location}/datasets/{dataset}`
374+
string parent = 1 [
375+
(google.api.field_behavior) = REQUIRED,
376+
(google.api.resource_reference) = {
377+
type: "aiplatform.googleapis.com/Dataset"
378+
}
379+
];
380+
381+
// The standard list filter.
382+
string filter = 2;
383+
384+
// The standard list page size.
385+
int32 page_size = 3;
386+
387+
// The standard list page token.
388+
string page_token = 4;
389+
390+
// Mask specifying which fields to read.
391+
google.protobuf.FieldMask read_mask = 5;
392+
393+
// A comma-separated list of fields to order by, sorted in ascending order.
394+
// Use "desc" after a field name for descending.
395+
string order_by = 6;
396+
}
397+
398+
// Response message for [DatasetService.ListSavedQueries][google.cloud.aiplatform.v1beta1.DatasetService.ListSavedQueries].
399+
message ListSavedQueriesResponse {
400+
// A list of SavedQueries that match the specified filter in the request.
401+
repeated SavedQuery saved_queries = 1;
402+
403+
// The standard List next-page token.
404+
string next_page_token = 2;
405+
}
406+
360407
// Request message for [DatasetService.GetAnnotationSpec][google.cloud.aiplatform.v1beta1.DatasetService.GetAnnotationSpec].
361408
message GetAnnotationSpecRequest {
362409
// Required. The name of the AnnotationSpec resource.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.aiplatform.v1beta1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/api/resource.proto";
21+
import "google/protobuf/struct.proto";
22+
import "google/protobuf/timestamp.proto";
23+
24+
option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
25+
option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform";
26+
option java_multiple_files = true;
27+
option java_outer_classname = "SavedQueryProto";
28+
option java_package = "com.google.cloud.aiplatform.v1beta1";
29+
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
30+
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
31+
32+
// A SavedQuery is a view of the dataset. It references a subset of annotations
33+
// by problem type and filters.
34+
message SavedQuery {
35+
option (google.api.resource) = {
36+
type: "aiplatform.googleapis.com/SavedQuery"
37+
pattern: "projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}"
38+
};
39+
40+
// Output only. Resource name of the SavedQuery.
41+
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
42+
43+
// Required. The user-defined name of the SavedQuery.
44+
// The name can be up to 128 characters long and can consist of any UTF-8
45+
// characters.
46+
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
47+
48+
// Some additional information about the SavedQuery.
49+
google.protobuf.Value metadata = 12;
50+
51+
// Output only. Timestamp when this SavedQuery was created.
52+
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
53+
54+
// Output only. Timestamp when SavedQuery was last updated.
55+
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
56+
57+
// Output only. Filters on the Annotations in the dataset.
58+
string annotation_filter = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
59+
60+
// Required. Problem type of the SavedQuery.
61+
// Allowed values:
62+
// * IMAGE_CLASSIFICATION_SINGLE_LABEL
63+
// * IMAGE_CLASSIFICATION_MULTI_LABEL
64+
// * IMAGE_BOUNDING_POLY
65+
// * IMAGE_BOUNDING_BOX
66+
// * TEXT_CLASSIFICATION_SINGLE_LABEL
67+
// * TEXT_CLASSIFICATION_MULTI_LABEL
68+
// * TEXT_EXTRACTION
69+
// * TEXT_SENTIMENT
70+
// * VIDEO_CLASSIFICATION
71+
// * VIDEO_OBJECT_TRACKING
72+
string problem_type = 6 [(google.api.field_behavior) = REQUIRED];
73+
74+
// Output only. Number of AnnotationSpecs in the context of the SavedQuery.
75+
int32 annotation_spec_count = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
76+
77+
// Used to perform a consistent read-modify-write update. If not set, a blind
78+
// "overwrite" update happens.
79+
string etag = 8;
80+
81+
// Output only. If the Annotations belonging to the SavedQuery can be used for AutoML
82+
// training.
83+
bool support_automl_training = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
84+
}

google/cloud/aiplatform/v1beta1/training_pipeline.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,20 @@ message InputDataConfig {
276276
// for training are filtered by both [annotations_filter][google.cloud.aiplatform.v1beta1.InputDataConfig.annotations_filter] and
277277
// [annotation_schema_uri][google.cloud.aiplatform.v1beta1.InputDataConfig.annotation_schema_uri].
278278
string annotation_schema_uri = 9;
279+
280+
// Only applicable to Datasets that have SavedQueries.
281+
//
282+
// The ID of a SavedQuery (annotation set) under the Dataset specified by
283+
// [dataset_id][google.cloud.aiplatform.v1beta1.InputDataConfig.dataset_id] used for filtering Annotations for training.
284+
//
285+
// Only Annotations that are associated with this SavedQuery are used in
286+
// respectively training. When used in conjunction with
287+
// [annotations_filter][google.cloud.aiplatform.v1beta1.InputDataConfig.annotations_filter], the Annotations used for training are filtered by
288+
// both [saved_query_id][google.cloud.aiplatform.v1beta1.InputDataConfig.saved_query_id] and [annotations_filter][google.cloud.aiplatform.v1beta1.InputDataConfig.annotations_filter].
289+
//
290+
// Only one of [saved_query_id][google.cloud.aiplatform.v1beta1.InputDataConfig.saved_query_id] and [annotation_schema_uri][google.cloud.aiplatform.v1beta1.InputDataConfig.annotation_schema_uri] should be
291+
// specified as both of them represent the same thing: problem type.
292+
string saved_query_id = 7;
279293
}
280294

281295
// Assigns the input data to training, validation, and test sets as per the

0 commit comments

Comments
 (0)