|
20 | 20 | import datetime |
21 | 21 | import decimal |
22 | 22 |
|
23 | | -from google.cloud import bigquery_storage_v1beta2 |
24 | | -from google.cloud.bigquery_storage_v1beta2 import types |
25 | | -from google.cloud.bigquery_storage_v1beta2 import writer |
| 23 | +from google.cloud import bigquery_storage_v1 |
| 24 | +from google.cloud.bigquery_storage_v1 import types |
| 25 | +from google.cloud.bigquery_storage_v1 import writer |
26 | 26 | from google.protobuf import descriptor_pb2 |
27 | 27 |
|
28 | 28 | # If you make updates to the sample_data.proto protocol buffers definition, |
|
36 | 36 |
|
37 | 37 | def append_rows_proto2(project_id: str, dataset_id: str, table_id: str): |
38 | 38 | """Create a write stream, write some sample data, and commit the stream.""" |
39 | | - write_client = bigquery_storage_v1beta2.BigQueryWriteClient() |
| 39 | + write_client = bigquery_storage_v1.BigQueryWriteClient() |
40 | 40 | parent = write_client.table_path(project_id, dataset_id, table_id) |
41 | 41 | write_stream = types.WriteStream() |
42 | 42 |
|
43 | 43 | # When creating the stream, choose the type. Use the PENDING type to wait |
44 | 44 | # until the stream is committed before it is visible. See: |
45 | | - # https://cloud.google.com/bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1beta2#google.cloud.bigquery.storage.v1beta2.WriteStream.Type |
| 45 | + # https://cloud.google.com/bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1#google.cloud.bigquery.storage.v1.WriteStream.Type |
46 | 46 | write_stream.type_ = types.WriteStream.Type.PENDING |
47 | 47 | write_stream = write_client.create_write_stream( |
48 | 48 | parent=parent, write_stream=write_stream |
|
0 commit comments