Skip to content

Commit cb5170b

Browse files
authored
chore(bigquery_storage): fix up protobuf messages w/o summary docstrings (googleapis#9333)
Closes googleapis#9329.
1 parent 04112c1 commit cb5170b

File tree

8 files changed

+267
-84
lines changed

8 files changed

+267
-84
lines changed

bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,18 @@ def create_read_session(
241241
parent (str): Required. String of the form ``projects/{project_id}`` indicating the
242242
project this ReadSession is associated with. This is the project that
243243
will be billed for usage.
244-
table_modifiers (Union[dict, ~google.cloud.bigquery_storage_v1beta1.types.TableModifiers]): Optional. Any modifiers to the Table (e.g. snapshot timestamp).
244+
table_modifiers (Union[dict, ~google.cloud.bigquery_storage_v1beta1.types.TableModifiers]): Any modifiers to the Table (e.g. snapshot timestamp).
245245
246246
If a dict is provided, it must be of the same form as the protobuf
247247
message :class:`~google.cloud.bigquery_storage_v1beta1.types.TableModifiers`
248-
requested_streams (int): Optional. Initial number of streams. If unset or 0, we will
248+
requested_streams (int): Initial number of streams. If unset or 0, we will
249249
provide a value of streams so as to produce reasonable throughput. Must be
250250
non-negative. The number of streams may be lower than the requested number,
251251
depending on the amount parallelism that is reasonable for the table and
252252
the maximum amount of parallelism allowed by the system.
253253
254254
Streams must be read starting from offset 0.
255-
read_options (Union[dict, ~google.cloud.bigquery_storage_v1beta1.types.TableReadOptions]): Optional. Read options for this session (e.g. column selection, filters).
255+
read_options (Union[dict, ~google.cloud.bigquery_storage_v1beta1.types.TableReadOptions]): Read options for this session (e.g. column selection, filters).
256256
257257
If a dict is provided, it must be of the same form as the protobuf
258258
message :class:`~google.cloud.bigquery_storage_v1beta1.types.TableReadOptions`

bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class BigQueryStorageGrpcTransport(object):
3333
# in this service.
3434
_OAUTH_SCOPES = (
3535
"https://www.googleapis.com/auth/bigquery",
36+
"https://www.googleapis.com/auth/bigquery.readonly",
3637
"https://www.googleapis.com/auth/cloud-platform",
3738
)
3839

bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage.proto

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ syntax = "proto3";
1818
package google.cloud.bigquery.storage.v1beta1;
1919

2020
import "google/api/annotations.proto";
21+
import "google/api/client.proto";
22+
import "google/api/field_behavior.proto";
23+
import "google/api/resource.proto";
2124
import "google/cloud/bigquery/storage/v1beta1/arrow.proto";
2225
import "google/cloud/bigquery/storage/v1beta1/avro.proto";
2326
import "google/cloud/bigquery/storage/v1beta1/read_options.proto";
2427
import "google/cloud/bigquery/storage/v1beta1/table_reference.proto";
2528
import "google/protobuf/empty.proto";
2629
import "google/protobuf/timestamp.proto";
27-
import "google/api/client.proto";
2830

2931
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage";
3032
option java_package = "com.google.cloud.bigquery.storage.v1beta1";
@@ -36,6 +38,7 @@ service BigQueryStorage {
3638
option (google.api.default_host) = "bigquerystorage.googleapis.com";
3739
option (google.api.oauth_scopes) =
3840
"https://www.googleapis.com/auth/bigquery,"
41+
"https://www.googleapis.com/auth/bigquery.readonly,"
3942
"https://www.googleapis.com/auth/cloud-platform";
4043

4144
// Creates a new read session. A read session divides the contents of a
@@ -59,6 +62,7 @@ service BigQueryStorage {
5962
body: "*"
6063
}
6164
};
65+
option (google.api.method_signature) = "table_reference,parent,requested_streams";
6266
}
6367

6468
// Reads rows from the table in the format prescribed by the read session.
@@ -74,6 +78,7 @@ service BigQueryStorage {
7478
option (google.api.http) = {
7579
get: "/v1beta1/{read_position.stream.name=projects/*/streams/*}"
7680
};
81+
option (google.api.method_signature) = "read_position";
7782
}
7883

7984
// Creates additional streams for a ReadSession. This API can be used to
@@ -84,6 +89,7 @@ service BigQueryStorage {
8489
post: "/v1beta1/{session.name=projects/*/sessions/*}"
8590
body: "*"
8691
};
92+
option (google.api.method_signature) = "session,requested_streams";
8793
}
8894

8995
// Triggers the graceful termination of a single stream in a ReadSession. This
@@ -105,6 +111,7 @@ service BigQueryStorage {
105111
post: "/v1beta1/{stream.name=projects/*/streams/*}"
106112
body: "*"
107113
};
114+
option (google.api.method_signature) = "stream";
108115
}
109116

110117
// Splits a given read stream into two Streams. These streams are referred to
@@ -124,11 +131,17 @@ service BigQueryStorage {
124131
option (google.api.http) = {
125132
get: "/v1beta1/{original_stream.name=projects/*/streams/*}"
126133
};
134+
option (google.api.method_signature) = "original_stream";
127135
}
128136
}
129137

130138
// Information about a single data stream within a read session.
131139
message Stream {
140+
option (google.api.resource) = {
141+
type: "bigquerystorage.googleapis.com/Stream"
142+
pattern: "projects/{project}/locations/{location}/streams/{stream}"
143+
};
144+
132145
// Name of the stream, in the form
133146
// `projects/{project_id}/locations/{location}/streams/{stream_id}`.
134147
string name = 1;
@@ -145,6 +158,11 @@ message StreamPosition {
145158

146159
// Information returned from a `CreateReadSession` request.
147160
message ReadSession {
161+
option (google.api.resource) = {
162+
type: "bigquerystorage.googleapis.com/ReadSession"
163+
pattern: "projects/{project}/locations/{location}/sessions/{session}"
164+
};
165+
148166
// Unique identifier for the session, in the form
149167
// `projects/{project_id}/locations/{location}/sessions/{session_id}`.
150168
string name = 1;
@@ -181,17 +199,17 @@ message ReadSession {
181199
// requested parallelism, projection filters and constraints.
182200
message CreateReadSessionRequest {
183201
// Required. Reference to the table to read.
184-
TableReference table_reference = 1;
202+
TableReference table_reference = 1 [(google.api.field_behavior) = REQUIRED];
185203

186204
// Required. String of the form `projects/{project_id}` indicating the
187205
// project this ReadSession is associated with. This is the project that will
188206
// be billed for usage.
189-
string parent = 6;
207+
string parent = 6 [(google.api.field_behavior) = REQUIRED];
190208

191-
// Optional. Any modifiers to the Table (e.g. snapshot timestamp).
209+
// Any modifiers to the Table (e.g. snapshot timestamp).
192210
TableModifiers table_modifiers = 2;
193211

194-
// Optional. Initial number of streams. If unset or 0, we will
212+
// Initial number of streams. If unset or 0, we will
195213
// provide a value of streams so as to produce reasonable throughput. Must be
196214
// non-negative. The number of streams may be lower than the requested number,
197215
// depending on the amount parallelism that is reasonable for the table and
@@ -200,7 +218,7 @@ message CreateReadSessionRequest {
200218
// Streams must be read starting from offset 0.
201219
int32 requested_streams = 3;
202220

203-
// Optional. Read options for this session (e.g. column selection, filters).
221+
// Read options for this session (e.g. column selection, filters).
204222
TableReadOptions read_options = 4;
205223

206224
// Data output format. Currently default to Avro.
@@ -248,7 +266,7 @@ message ReadRowsRequest {
248266
// Required. Identifier of the position in the stream to start reading from.
249267
// The offset requested must be less than the last row read from ReadRows.
250268
// Requesting a larger offset is undefined.
251-
StreamPosition read_position = 1;
269+
StreamPosition read_position = 1 [(google.api.field_behavior) = REQUIRED];
252270
}
253271

254272
// Progress information for a given Stream.
@@ -267,6 +285,12 @@ message StreamStatus {
267285
// sharding strategy.
268286
float fraction_consumed = 2;
269287

288+
// Represents the progress of the current stream.
289+
//
290+
// Note: This value is under development and should not be used. Use
291+
// `fraction_consumed` instead.
292+
Progress progress = 4;
293+
270294
// Whether this stream can be split. For sessions that use the LIQUID sharding
271295
// strategy, this value is always false. For BALANCED sessions, this value is
272296
// false when enough data have been read such that no more splits are possible
@@ -275,6 +299,25 @@ message StreamStatus {
275299
bool is_splittable = 3;
276300
}
277301

302+
message Progress {
303+
// The fraction of rows assigned to the stream that have been processed by the
304+
// server so far, not including the rows in the current response message.
305+
//
306+
// This value, along with `at_response_end`, can be used to interpolate the
307+
// progress made as the rows in the message are being processed using the
308+
// following formula: `at_response_start + (at_response_end -
309+
// at_response_start) * rows_processed_from_response / rows_in_response`.
310+
//
311+
// Note that if a filter is provided, the `at_response_end` value of the
312+
// previous response may not necessarily be equal to the `at_response_start`
313+
// value of the current response.
314+
float at_response_start = 1;
315+
316+
// Similar to `at_response_start`, except that this value includes the rows in
317+
// the current response.
318+
float at_response_end = 2;
319+
}
320+
278321
// Information on if the current connection is being throttled.
279322
message ThrottleStatus {
280323
// How much this connection is being throttled.
@@ -313,12 +356,12 @@ message ReadRowsResponse {
313356
message BatchCreateReadSessionStreamsRequest {
314357
// Required. Must be a non-expired session obtained from a call to
315358
// CreateReadSession. Only the name field needs to be set.
316-
ReadSession session = 1;
359+
ReadSession session = 1 [(google.api.field_behavior) = REQUIRED];
317360

318361
// Required. Number of new streams requested. Must be positive.
319362
// Number of added streams may be less than this, see CreateReadSessionRequest
320363
// for more information.
321-
int32 requested_streams = 2;
364+
int32 requested_streams = 2 [(google.api.field_behavior) = REQUIRED];
322365
}
323366

324367
// The response from `BatchCreateReadSessionStreams` returns the stream

0 commit comments

Comments
 (0)