Skip to content

Commit

Permalink
feat: add default_missing_value_interpretation field; indicate KMS_SE…
Browse files Browse the repository at this point in the history
…RVICE_ERROR is retryable (#637)

* feat: add beta2 deprecation message

PiperOrigin-RevId: 556875976

Source-Link: googleapis/googleapis@29b8ec7

Source-Link: googleapis/googleapis-gen@cc401b7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2M0MDFiN2NhYzVjNzdjNjgxMDU2Yzc4OGFiMWM4ZTIwMjVlN2JhNiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add default_missing_value_interpretation field; indicate KMS_SERVICE_ERROR is retryable

PiperOrigin-RevId: 556931084

Source-Link: googleapis/googleapis@ca3d7e8

Source-Link: googleapis/googleapis-gen@861a1c3
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODYxYTFjMzQ2MjRhNTcyNTEzNDVjODIwZDY5ODg3YTQ5NWVlNDE3YSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Aug 23, 2023
1 parent 97d3db1 commit 9550ea6
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 2 deletions.
21 changes: 20 additions & 1 deletion google/cloud/bigquery_storage_v1/types/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,20 @@ class AppendRowsRequest(proto.Message):
Currently, field name can only be top-level column name,
can't be a struct field path like 'foo.bar'.
default_missing_value_interpretation (google.cloud.bigquery_storage_v1.types.AppendRowsRequest.MissingValueInterpretation):
Optional. Default missing value interpretation for all
columns in the table. When a value is specified on an
``AppendRowsRequest``, it is applied to all requests on the
connection from that point forward, until a subsequent
``AppendRowsRequest`` sets it to a different value.
``missing_value_interpretation`` can override
``default_missing_value_interpretation``. For example, if
you want to write ``NULL`` instead of using default values
for some columns, you can set
``default_missing_value_interpretation`` to
``DEFAULT_VALUE`` and at the same time, set
``missing_value_interpretations`` to ``NULL_VALUE`` on those
columns.
"""

class MissingValueInterpretation(proto.Enum):
Expand Down Expand Up @@ -521,6 +535,11 @@ class ProtoData(proto.Message):
number=7,
enum=MissingValueInterpretation,
)
default_missing_value_interpretation: MissingValueInterpretation = proto.Field(
proto.ENUM,
number=8,
enum=MissingValueInterpretation,
)


class AppendRowsResponse(proto.Message):
Expand Down Expand Up @@ -825,7 +844,7 @@ class StorageErrorCode(proto.Enum):
customer-managed encryption key.
KMS_SERVICE_ERROR (13):
Key Management Service (KMS) service returned
an error.
an error, which can be retried.
KMS_PERMISSION_DENIED (14):
Permission denied while using
customer-managed encryption key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@

class BigQueryWriteAsyncClient:
"""BigQuery Write API.
The Write API can be used to write data to BigQuery.
The `google.cloud.bigquery.storage.v1
API </bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1>`__
should be used instead of the v1beta2 API for BigQueryWrite
operations.
"""

_client: BigQueryWriteClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ def get_transport_class(

class BigQueryWriteClient(metaclass=BigQueryWriteClientMeta):
"""BigQuery Write API.
The Write API can be used to write data to BigQuery.
The `google.cloud.bigquery.storage.v1
API </bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1>`__
should be used instead of the v1beta2 API for BigQueryWrite
operations.
"""

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ class BigQueryWriteGrpcTransport(BigQueryWriteTransport):
"""gRPC backend transport for BigQueryWrite.
BigQuery Write API.
The Write API can be used to write data to BigQuery.
The `google.cloud.bigquery.storage.v1
API </bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1>`__
should be used instead of the v1beta2 API for BigQueryWrite
operations.
This class defines the same methods as the primary client, so the
primary client can load the underlying transport implementation
and call it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ class BigQueryWriteGrpcAsyncIOTransport(BigQueryWriteTransport):
"""gRPC AsyncIO backend transport for BigQueryWrite.
BigQuery Write API.
The Write API can be used to write data to BigQuery.
The `google.cloud.bigquery.storage.v1
API </bigquery/docs/reference/storage/rpc/google.cloud.bigquery.storage.v1>`__
should be used instead of the v1beta2 API for BigQueryWrite
operations.
This class defines the same methods as the primary client, so the
primary client can load the underlying transport implementation
and call it.
Expand Down
2 changes: 1 addition & 1 deletion scripts/fixup_bigquery_storage_v1_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def partition(
class bigquery_storageCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'append_rows': ('write_stream', 'offset', 'proto_rows', 'trace_id', 'missing_value_interpretations', ),
'append_rows': ('write_stream', 'offset', 'proto_rows', 'trace_id', 'missing_value_interpretations', 'default_missing_value_interpretation', ),
'batch_commit_write_streams': ('parent', 'write_streams', ),
'create_read_session': ('parent', 'read_session', 'max_stream_count', 'preferred_min_stream_count', ),
'create_write_stream': ('parent', 'write_stream', ),
Expand Down

0 comments on commit 9550ea6

Please sign in to comment.