From bf907d1f65ca7d886e1979bbafdf3cd1215e1216 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Sat, 23 Mar 2019 05:10:50 -0700 Subject: [PATCH 1/2] [CHANGE ME] Re-generated bigquery_storage to pick up changes in the API or client library generator. --- .../bigquery_storage_v1beta1/proto/avro.proto | 1 + .../proto/read_options.proto | 1 + .../proto/storage.proto | 42 +++++++-- .../proto/storage_pb2.py | 86 +++++++++++-------- .../proto/table_reference.proto | 2 + .../proto/table_reference_pb2.py | 16 ++-- bigquery_storage/synth.metadata | 10 +-- 7 files changed, 104 insertions(+), 54 deletions(-) diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/avro.proto b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/avro.proto index 021d8e44f9f2..699d70a671ec 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/avro.proto +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/avro.proto @@ -21,6 +21,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storag option java_outer_classname = "AvroProto"; option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + // Avro schema. message AvroSchema { // Json serialized schema, as described at diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/read_options.proto b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/read_options.proto index 9591deba7f47..8a3c66699f57 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/read_options.proto +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/read_options.proto @@ -20,6 +20,7 @@ package google.cloud.bigquery.storage.v1beta1; option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + // Options dictating how we read a table. message TableReadOptions { // Optional. Names of the fields in the table that should be read. If empty, diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage.proto b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage.proto index 9c4b18519b4b..4ea0b1060707 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage.proto +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage.proto @@ -17,6 +17,8 @@ syntax = "proto3"; package google.cloud.bigquery.storage.v1beta1; +import "google/api/annotations.proto"; +import "google/api/resource.proto"; import "google/cloud/bigquery/storage/v1beta1/avro.proto"; import "google/cloud/bigquery/storage/v1beta1/read_options.proto"; import "google/cloud/bigquery/storage/v1beta1/table_reference.proto"; @@ -26,6 +28,7 @@ import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + // BigQuery storage API. // // The BigQuery storage API can be used to read data stored in BigQuery. @@ -42,7 +45,16 @@ service BigQueryStorage { // // Read sessions automatically expire 24 hours after they are created and do // not require manual clean-up by the caller. - rpc CreateReadSession(CreateReadSessionRequest) returns (ReadSession) {} + rpc CreateReadSession(CreateReadSessionRequest) returns (ReadSession) { + option (google.api.http) = { + post: "/v1beta1/{table_reference.project_id=projects/*}" + body: "*" + additional_bindings { + post: "/v1beta1/{table_reference.dataset_id=projects/*/datasets/*}" + body: "*" + } + }; + } // Reads rows from the table in the format prescribed by the read session. // Each response contains one or more table rows, up to a maximum of 10 MiB @@ -53,13 +65,21 @@ service BigQueryStorage { // estimated total number of rows in the read stream. This number is computed // based on the total table size and the number of active streams in the read // session, and may change as other streams continue to read data. - rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) {} + rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) { + option (google.api.http) = { + get: "/v1beta1/{read_position.stream.name=projects/*/streams/*}" + }; + } // Creates additional streams for a ReadSession. This API can be used to // dynamically adjust the parallelism of a batch processing task upwards by // adding additional workers. - rpc BatchCreateReadSessionStreams(BatchCreateReadSessionStreamsRequest) - returns (BatchCreateReadSessionStreamsResponse) {} + rpc BatchCreateReadSessionStreams(BatchCreateReadSessionStreamsRequest) returns (BatchCreateReadSessionStreamsResponse) { + option (google.api.http) = { + post: "/v1beta1/{session.name=projects/*/sessions/*}" + body: "*" + }; + } // Triggers the graceful termination of a single stream in a ReadSession. This // API can be used to dynamically adjust the parallelism of a batch processing @@ -75,7 +95,12 @@ service BigQueryStorage { // This method will return an error if there are no other live streams // in the Session, or if SplitReadStream() has been called on the given // Stream. - rpc FinalizeStream(FinalizeStreamRequest) returns (google.protobuf.Empty) {} + rpc FinalizeStream(FinalizeStreamRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{stream.name=projects/*/streams/*}" + body: "*" + }; + } // Splits a given read stream into two Streams. These streams are referred to // as the primary and the residual of the split. The original stream can still @@ -90,8 +115,11 @@ service BigQueryStorage { // completion. // // This method is guaranteed to be idempotent. - rpc SplitReadStream(SplitReadStreamRequest) - returns (SplitReadStreamResponse) {} + rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) { + option (google.api.http) = { + get: "/v1beta1/{original_stream.name=projects/*/streams/*}" + }; + } } // Information about a single data stream within a read session. diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py index 8a246cebf944..608efd7f9950 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py @@ -15,6 +15,8 @@ _sym_db = _symbol_database.Default() +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.bigquery_storage_v1beta1.proto import ( avro_pb2 as google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_avro__pb2, ) @@ -36,9 +38,11 @@ "\n)com.google.cloud.bigquery.storage.v1beta1ZLgoogle.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage" ), serialized_pb=_b( - '\n9google/cloud/bigquery/storage_v1beta1/proto/storage.proto\x12%google.cloud.bigquery.storage.v1beta1\x1a\x36google/cloud/bigquery/storage_v1beta1/proto/avro.proto\x1a>google/cloud/bigquery/storage_v1beta1/proto/read_options.proto\x1a\x41google/cloud/bigquery/storage_v1beta1/proto/table_reference.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto")\n\x06Stream\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\trow_count\x18\x02 \x01(\x03"_\n\x0eStreamPosition\x12=\n\x06stream\x18\x01 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream\x12\x0e\n\x06offset\x18\x02 \x01(\x03"\x80\x03\n\x0bReadSession\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12H\n\x0b\x61vro_schema\x18\x05 \x01(\x0b\x32\x31.google.cloud.bigquery.storage.v1beta1.AvroSchemaH\x00\x12>\n\x07streams\x18\x04 \x03(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream\x12N\n\x0ftable_reference\x18\x07 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableReference\x12N\n\x0ftable_modifiers\x18\x08 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableModifiersB\x08\n\x06schema"\xf7\x02\n\x18\x43reateReadSessionRequest\x12N\n\x0ftable_reference\x18\x01 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableReference\x12\x0e\n\x06parent\x18\x06 \x01(\t\x12N\n\x0ftable_modifiers\x18\x02 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableModifiers\x12\x19\n\x11requested_streams\x18\x03 \x01(\x05\x12M\n\x0cread_options\x18\x04 \x01(\x0b\x32\x37.google.cloud.bigquery.storage.v1beta1.TableReadOptions\x12\x41\n\x06\x66ormat\x18\x05 \x01(\x0e\x32\x31.google.cloud.bigquery.storage.v1beta1.DataFormat"_\n\x0fReadRowsRequest\x12L\n\rread_position\x18\x01 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.StreamPosition"+\n\x0cStreamStatus\x12\x1b\n\x13\x65stimated_row_count\x18\x01 \x01(\x03"*\n\x0eThrottleStatus\x12\x18\n\x10throttle_percent\x18\x01 \x01(\x05"\xf5\x01\n\x10ReadRowsResponse\x12\x44\n\tavro_rows\x18\x03 \x01(\x0b\x32/.google.cloud.bigquery.storage.v1beta1.AvroRowsH\x00\x12\x43\n\x06status\x18\x02 \x01(\x0b\x32\x33.google.cloud.bigquery.storage.v1beta1.StreamStatus\x12N\n\x0fthrottle_status\x18\x05 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.ThrottleStatusB\x06\n\x04rows"\x86\x01\n$BatchCreateReadSessionStreamsRequest\x12\x43\n\x07session\x18\x01 \x01(\x0b\x32\x32.google.cloud.bigquery.storage.v1beta1.ReadSession\x12\x19\n\x11requested_streams\x18\x02 \x01(\x05"g\n%BatchCreateReadSessionStreamsResponse\x12>\n\x07streams\x18\x01 \x03(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream"V\n\x15\x46inalizeStreamRequest\x12=\n\x06stream\x18\x02 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream"`\n\x16SplitReadStreamRequest\x12\x46\n\x0foriginal_stream\x18\x01 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream"\xa9\x01\n\x17SplitReadStreamResponse\x12\x45\n\x0eprimary_stream\x18\x01 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream\x12G\n\x10remainder_stream\x18\x02 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream*3\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41VRO\x10\x01\x32\xdd\x05\n\x0f\x42igQueryStorage\x12\x8a\x01\n\x11\x43reateReadSession\x12?.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest\x1a\x32.google.cloud.bigquery.storage.v1beta1.ReadSession"\x00\x12\x7f\n\x08ReadRows\x12\x36.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest\x1a\x37.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse"\x00\x30\x01\x12\xbc\x01\n\x1d\x42\x61tchCreateReadSessionStreams\x12K.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest\x1aL.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse"\x00\x12h\n\x0e\x46inalizeStream\x12<.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest\x1a\x16.google.protobuf.Empty"\x00\x12\x92\x01\n\x0fSplitReadStream\x12=.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest\x1a>.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse"\x00\x42y\n)com.google.cloud.bigquery.storage.v1beta1ZLgoogle.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storageb\x06proto3' + '\n9google/cloud/bigquery/storage_v1beta1/proto/storage.proto\x12%google.cloud.bigquery.storage.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/bigquery/storage_v1beta1/proto/avro.proto\x1a>google/cloud/bigquery/storage_v1beta1/proto/read_options.proto\x1a\x41google/cloud/bigquery/storage_v1beta1/proto/table_reference.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto")\n\x06Stream\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\trow_count\x18\x02 \x01(\x03"_\n\x0eStreamPosition\x12=\n\x06stream\x18\x01 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream\x12\x0e\n\x06offset\x18\x02 \x01(\x03"\x80\x03\n\x0bReadSession\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12H\n\x0b\x61vro_schema\x18\x05 \x01(\x0b\x32\x31.google.cloud.bigquery.storage.v1beta1.AvroSchemaH\x00\x12>\n\x07streams\x18\x04 \x03(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream\x12N\n\x0ftable_reference\x18\x07 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableReference\x12N\n\x0ftable_modifiers\x18\x08 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableModifiersB\x08\n\x06schema"\xf7\x02\n\x18\x43reateReadSessionRequest\x12N\n\x0ftable_reference\x18\x01 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableReference\x12\x0e\n\x06parent\x18\x06 \x01(\t\x12N\n\x0ftable_modifiers\x18\x02 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.TableModifiers\x12\x19\n\x11requested_streams\x18\x03 \x01(\x05\x12M\n\x0cread_options\x18\x04 \x01(\x0b\x32\x37.google.cloud.bigquery.storage.v1beta1.TableReadOptions\x12\x41\n\x06\x66ormat\x18\x05 \x01(\x0e\x32\x31.google.cloud.bigquery.storage.v1beta1.DataFormat"_\n\x0fReadRowsRequest\x12L\n\rread_position\x18\x01 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.StreamPosition"+\n\x0cStreamStatus\x12\x1b\n\x13\x65stimated_row_count\x18\x01 \x01(\x03"*\n\x0eThrottleStatus\x12\x18\n\x10throttle_percent\x18\x01 \x01(\x05"\xf5\x01\n\x10ReadRowsResponse\x12\x44\n\tavro_rows\x18\x03 \x01(\x0b\x32/.google.cloud.bigquery.storage.v1beta1.AvroRowsH\x00\x12\x43\n\x06status\x18\x02 \x01(\x0b\x32\x33.google.cloud.bigquery.storage.v1beta1.StreamStatus\x12N\n\x0fthrottle_status\x18\x05 \x01(\x0b\x32\x35.google.cloud.bigquery.storage.v1beta1.ThrottleStatusB\x06\n\x04rows"\x86\x01\n$BatchCreateReadSessionStreamsRequest\x12\x43\n\x07session\x18\x01 \x01(\x0b\x32\x32.google.cloud.bigquery.storage.v1beta1.ReadSession\x12\x19\n\x11requested_streams\x18\x02 \x01(\x05"g\n%BatchCreateReadSessionStreamsResponse\x12>\n\x07streams\x18\x01 \x03(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream"V\n\x15\x46inalizeStreamRequest\x12=\n\x06stream\x18\x02 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream"`\n\x16SplitReadStreamRequest\x12\x46\n\x0foriginal_stream\x18\x01 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream"\xa9\x01\n\x17SplitReadStreamResponse\x12\x45\n\x0eprimary_stream\x18\x01 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream\x12G\n\x10remainder_stream\x18\x02 \x01(\x0b\x32-.google.cloud.bigquery.storage.v1beta1.Stream*3\n\nDataFormat\x12\x1b\n\x17\x44\x41TA_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04\x41VRO\x10\x01\x32\xc7\x08\n\x0f\x42igQueryStorage\x12\x87\x02\n\x11\x43reateReadSession\x12?.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest\x1a\x32.google.cloud.bigquery.storage.v1beta1.ReadSession"}\x82\xd3\xe4\x93\x02w"0/v1beta1/{table_reference.project_id=projects/*}:\x01*Z@";/v1beta1/{table_reference.dataset_id=projects/*/datasets/*}:\x01*\x12\xc0\x01\n\x08ReadRows\x12\x36.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest\x1a\x37.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse"A\x82\xd3\xe4\x93\x02;\x12\x39/v1beta1/{read_position.stream.name=projects/*/streams/*}0\x01\x12\xf4\x01\n\x1d\x42\x61tchCreateReadSessionStreams\x12K.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest\x1aL.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse"8\x82\xd3\xe4\x93\x02\x32"-/v1beta1/{session.name=projects/*/sessions/*}:\x01*\x12\x9e\x01\n\x0e\x46inalizeStream\x12<.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest\x1a\x16.google.protobuf.Empty"6\x82\xd3\xe4\x93\x02\x30"+/v1beta1/{stream.name=projects/*/streams/*}:\x01*\x12\xce\x01\n\x0fSplitReadStream\x12=.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest\x1a>.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse"<\x82\xd3\xe4\x93\x02\x36\x12\x34/v1beta1/{original_stream.name=projects/*/streams/*}By\n)com.google.cloud.bigquery.storage.v1beta1ZLgoogle.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storageb\x06proto3' ), dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_avro__pb2.DESCRIPTOR, google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_read__options__pb2.DESCRIPTOR, google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_table__reference__pb2.DESCRIPTOR, @@ -66,8 +70,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2288, - serialized_end=2339, + serialized_start=2345, + serialized_end=2396, ) _sym_db.RegisterEnumDescriptor(_DATAFORMAT) @@ -128,8 +132,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=349, - serialized_end=390, + serialized_start=406, + serialized_end=447, ) @@ -185,8 +189,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=392, - serialized_end=487, + serialized_start=449, + serialized_end=544, ) @@ -322,8 +326,8 @@ fields=[], ) ], - serialized_start=490, - serialized_end=874, + serialized_start=547, + serialized_end=931, ) @@ -451,8 +455,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=877, - serialized_end=1252, + serialized_start=934, + serialized_end=1309, ) @@ -490,8 +494,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1254, - serialized_end=1349, + serialized_start=1311, + serialized_end=1406, ) @@ -529,8 +533,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1351, - serialized_end=1394, + serialized_start=1408, + serialized_end=1451, ) @@ -568,8 +572,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1396, - serialized_end=1438, + serialized_start=1453, + serialized_end=1495, ) @@ -651,8 +655,8 @@ fields=[], ) ], - serialized_start=1441, - serialized_end=1686, + serialized_start=1498, + serialized_end=1743, ) @@ -708,8 +712,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1689, - serialized_end=1823, + serialized_start=1746, + serialized_end=1880, ) @@ -747,8 +751,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1825, - serialized_end=1928, + serialized_start=1882, + serialized_end=1985, ) @@ -786,8 +790,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1930, - serialized_end=2016, + serialized_start=1987, + serialized_end=2073, ) @@ -825,8 +829,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2018, - serialized_end=2114, + serialized_start=2075, + serialized_end=2171, ) @@ -882,8 +886,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2117, - serialized_end=2286, + serialized_start=2174, + serialized_end=2343, ) _STREAMPOSITION.fields_by_name["stream"].message_type = _STREAM @@ -1283,8 +1287,8 @@ file=DESCRIPTOR, index=0, serialized_options=None, - serialized_start=2342, - serialized_end=3075, + serialized_start=2399, + serialized_end=3494, methods=[ _descriptor.MethodDescriptor( name="CreateReadSession", @@ -1293,7 +1297,9 @@ containing_service=None, input_type=_CREATEREADSESSIONREQUEST, output_type=_READSESSION, - serialized_options=None, + serialized_options=_b( + '\202\323\344\223\002w"0/v1beta1/{table_reference.project_id=projects/*}:\001*Z@";/v1beta1/{table_reference.dataset_id=projects/*/datasets/*}:\001*' + ), ), _descriptor.MethodDescriptor( name="ReadRows", @@ -1302,7 +1308,9 @@ containing_service=None, input_type=_READROWSREQUEST, output_type=_READROWSRESPONSE, - serialized_options=None, + serialized_options=_b( + "\202\323\344\223\002;\0229/v1beta1/{read_position.stream.name=projects/*/streams/*}" + ), ), _descriptor.MethodDescriptor( name="BatchCreateReadSessionStreams", @@ -1311,7 +1319,9 @@ containing_service=None, input_type=_BATCHCREATEREADSESSIONSTREAMSREQUEST, output_type=_BATCHCREATEREADSESSIONSTREAMSRESPONSE, - serialized_options=None, + serialized_options=_b( + '\202\323\344\223\0022"-/v1beta1/{session.name=projects/*/sessions/*}:\001*' + ), ), _descriptor.MethodDescriptor( name="FinalizeStream", @@ -1320,7 +1330,9 @@ containing_service=None, input_type=_FINALIZESTREAMREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=None, + serialized_options=_b( + '\202\323\344\223\0020"+/v1beta1/{stream.name=projects/*/streams/*}:\001*' + ), ), _descriptor.MethodDescriptor( name="SplitReadStream", @@ -1329,7 +1341,9 @@ containing_service=None, input_type=_SPLITREADSTREAMREQUEST, output_type=_SPLITREADSTREAMRESPONSE, - serialized_options=None, + serialized_options=_b( + "\202\323\344\223\0026\0224/v1beta1/{original_stream.name=projects/*/streams/*}" + ), ), ], ) diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference.proto b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference.proto index fb74bbf6c642..0d513898d126 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference.proto +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference.proto @@ -17,12 +17,14 @@ syntax = "proto3"; package google.cloud.bigquery.storage.v1beta1; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; option java_outer_classname = "TableReferenceProto"; option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + // Table reference that includes just the 3 strings needed to identify a table. message TableReference { // The assigned project ID of the project. diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference_pb2.py b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference_pb2.py index c49efe7ea9a9..cf4133213b32 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference_pb2.py +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/table_reference_pb2.py @@ -14,6 +14,7 @@ _sym_db = _symbol_database.Default() +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 @@ -25,9 +26,12 @@ "\n)com.google.cloud.bigquery.storage.v1beta1B\023TableReferenceProtoZLgoogle.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage" ), serialized_pb=_b( - '\nAgoogle/cloud/bigquery/storage_v1beta1/proto/table_reference.proto\x12%google.cloud.bigquery.storage.v1beta1\x1a\x1fgoogle/protobuf/timestamp.proto"J\n\x0eTableReference\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08table_id\x18\x03 \x01(\t"C\n\x0eTableModifiers\x12\x31\n\rsnapshot_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x8e\x01\n)com.google.cloud.bigquery.storage.v1beta1B\x13TableReferenceProtoZLgoogle.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storageb\x06proto3' + '\nAgoogle/cloud/bigquery/storage_v1beta1/proto/table_reference.proto\x12%google.cloud.bigquery.storage.v1beta1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto"J\n\x0eTableReference\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08table_id\x18\x03 \x01(\t"C\n\x0eTableModifiers\x12\x31\n\rsnapshot_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x8e\x01\n)com.google.cloud.bigquery.storage.v1beta1B\x13TableReferenceProtoZLgoogle.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storageb\x06proto3' ), - dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR], + dependencies=[ + google_dot_api_dot_resource__pb2.DESCRIPTOR, + google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, + ], ) @@ -101,8 +105,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=141, - serialized_end=215, + serialized_start=168, + serialized_end=242, ) @@ -140,8 +144,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=217, - serialized_end=284, + serialized_start=244, + serialized_end=311, ) _TABLEMODIFIERS.fields_by_name[ diff --git a/bigquery_storage/synth.metadata b/bigquery_storage/synth.metadata index 3234af72c24c..55234250f9ac 100644 --- a/bigquery_storage/synth.metadata +++ b/bigquery_storage/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-02T13:10:44.304044Z", + "updateTime": "2019-03-23T12:10:50.029031Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.14", - "dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7" + "version": "0.16.19", + "dockerImage": "googleapis/artman@sha256:70ba28fda87e032ae44e6df41b7fc342c1b0cce1ed90658c4890eb4f613038c2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "41d72d444fbe445f4da89e13be02078734fb7875", - "internalRef": "236230004" + "sha": "e80435a132c53da26f46daf0787035ee63fb942b", + "internalRef": "239938670" } } ], From 747871af35699be363149f64814ec8a023622b06 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Mon, 25 Mar 2019 14:55:45 -0700 Subject: [PATCH 2/2] Remove unnecessary dependency on google.api.resource. --- .../proto/storage_pb2.py | 2 - bigquery_storage/synth.metadata | 4 +- bigquery_storage/synth.py | 116 ++++++++++-------- 3 files changed, 70 insertions(+), 52 deletions(-) diff --git a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py index 608efd7f9950..0402a96c05d5 100644 --- a/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py +++ b/bigquery_storage/google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py @@ -16,7 +16,6 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.bigquery_storage_v1beta1.proto import ( avro_pb2 as google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_avro__pb2, ) @@ -42,7 +41,6 @@ ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_avro__pb2.DESCRIPTOR, google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_read__options__pb2.DESCRIPTOR, google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_table__reference__pb2.DESCRIPTOR, diff --git a/bigquery_storage/synth.metadata b/bigquery_storage/synth.metadata index 55234250f9ac..2167ef7b8eb5 100644 --- a/bigquery_storage/synth.metadata +++ b/bigquery_storage/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-03-23T12:10:50.029031Z", + "updateTime": "2019-03-25T21:54:47.957767Z", "sources": [ { "generator": { @@ -11,7 +11,7 @@ { "git": { "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", + "remote": "git@github.com:googleapis/googleapis.git", "sha": "e80435a132c53da26f46daf0787035ee63fb942b", "internalRef": "239938670" } diff --git a/bigquery_storage/synth.py b/bigquery_storage/synth.py index bd3247eb6d5f..6940e1550e8f 100644 --- a/bigquery_storage/synth.py +++ b/bigquery_storage/synth.py @@ -19,97 +19,117 @@ gapic = gcp.GAPICGenerator() -version = 'v1beta1' +version = "v1beta1" library = gapic.py_library( - 'bigquery_storage', + "bigquery_storage", version, - config_path='/google/cloud/bigquery/storage/' - 'artman_bigquerystorage_v1beta1.yaml', - artman_output_name='bigquerystorage-v1beta1', + config_path="/google/cloud/bigquery/storage/" "artman_bigquerystorage_v1beta1.yaml", + artman_output_name="bigquerystorage-v1beta1", include_protos=True, ) s.move( library, excludes=[ - 'docs/conf.py', - 'docs/index.rst', - 'google/cloud/bigquery_storage_v1beta1/__init__.py', - 'README.rst', - 'nox*.py', - 'setup.py', - 'setup.cfg', + "docs/conf.py", + "docs/index.rst", + "google/cloud/bigquery_storage_v1beta1/__init__.py", + "README.rst", + "nox*.py", + "setup.py", + "setup.cfg", ], ) +# START: Remove unnecessary dependency on google.api.resource protos. s.replace( - ['google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py', - 'google/cloud/bigquery_storage_v1beta1/proto/storage_pb2_grpc.py'], - 'from google.cloud.bigquery.storage_v1beta1.proto', - 'from google.cloud.bigquery_storage_v1beta1.proto', + ["google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py"], + "from google.api import resource_pb2 as google_dot_api_dot_resource__pb2\n", + "", ) s.replace( - 'google/cloud/bigquery_storage_v1beta1/gapic/' - 'big_query_storage_client.py', - 'google-cloud-bigquerystorage', - 'google-cloud-bigquery-storage') + ["google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py"], + "google_dot_api_dot_resource__pb2.DESCRIPTOR,", + "", +) +# END: Remove unnecessary dependency on google.api.resource protos. + +s.replace( + [ + "google/cloud/bigquery_storage_v1beta1/proto/storage_pb2.py", + "google/cloud/bigquery_storage_v1beta1/proto/storage_pb2_grpc.py", + ], + "from google.cloud.bigquery.storage_v1beta1.proto", + "from google.cloud.bigquery_storage_v1beta1.proto", +) s.replace( - 'google/cloud/bigquery_storage_v1beta1/gapic/' - 'big_query_storage_client.py', - 'import google.api_core.gapic_v1.method\n', - '\g<0>import google.api_core.path_template\n' + "google/cloud/bigquery_storage_v1beta1/gapic/" "big_query_storage_client.py", + "google-cloud-bigquerystorage", + "google-cloud-bigquery-storage", ) s.replace( - ['tests/unit/gapic/v1beta1/test_big_query_storage_client_v1beta1.py'], - 'from google.cloud import bigquery_storage_v1beta1', - 'from google.cloud.bigquery_storage_v1beta1.gapic import big_query_storage_client # noqa', + "google/cloud/bigquery_storage_v1beta1/gapic/" "big_query_storage_client.py", + "import google.api_core.gapic_v1.method\n", + "\g<0>import google.api_core.path_template\n", ) s.replace( - ['tests/unit/gapic/v1beta1/test_big_query_storage_client_v1beta1.py'], - 'bigquery_storage_v1beta1.BigQueryStorageClient', - 'big_query_storage_client.BigQueryStorageClient', + ["tests/unit/gapic/v1beta1/test_big_query_storage_client_v1beta1.py"], + "from google.cloud import bigquery_storage_v1beta1", + "from google.cloud.bigquery_storage_v1beta1.gapic import big_query_storage_client # noqa", +) + +s.replace( + ["tests/unit/gapic/v1beta1/test_big_query_storage_client_v1beta1.py"], + "bigquery_storage_v1beta1.BigQueryStorageClient", + "big_query_storage_client.BigQueryStorageClient", ) # START: Ignore lint and coverage s.replace( - ['google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py'], - 'if transport:', - 'if transport: # pragma: no cover', + ["google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py"], + "if transport:", + "if transport: # pragma: no cover", ) s.replace( - ['google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py'], - r'to_grpc_metadata\(\n', - 'to_grpc_metadata( # pragma: no cover\n', + ["google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py"], + r"to_grpc_metadata\(\n", + "to_grpc_metadata( # pragma: no cover\n", ) s.replace( - ['google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py'], - r'metadata.append\(routing_metadata\)', - 'metadata.append(routing_metadata) # pragma: no cover', + ["google/cloud/bigquery_storage_v1beta1/gapic/big_query_storage_client.py"], + r"metadata.append\(routing_metadata\)", + "metadata.append(routing_metadata) # pragma: no cover", ) s.replace( - ['google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py'], - 'if channel is not None and credentials is not None:', - 'if channel is not None and credentials is not None: # pragma: no cover', + [ + "google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py" + ], + "if channel is not None and credentials is not None:", + "if channel is not None and credentials is not None: # pragma: no cover", ) s.replace( - ['google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py'], - 'if channel is None:', - 'if channel is None: # pragma: no cover', + [ + "google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py" + ], + "if channel is None:", + "if channel is None: # pragma: no cover", ) s.replace( - ['google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py'], - r'google.api_core.grpc_helpers.create_channel\(', - 'google.api_core.grpc_helpers.create_channel( # pragma: no cover', + [ + "google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py" + ], + r"google.api_core.grpc_helpers.create_channel\(", + "google.api_core.grpc_helpers.create_channel( # pragma: no cover", ) # END: Ignore lint and coverage