googleapis / googleapis/google-cloud-python

Use shim for legacy client mutate_rows

Đang mở
#15,292 1 bình luận 0 reaction 1 người được giao Được @gkevinzheng nhận Xem trên GitHub
api: bigtable priority: p3 type: feature request
Ngôn ngữ chính
Python
Star
5.4k
Fork
1.8k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
122

Mô tả

From go/bigtable_legacy_deprecation:
> Old API
> - The [Table](https://github.com/googleapis/python-bigtable/blob/4492f9fe2760d423944672264c2c1770488a9c8c/google/cloud/bigtable/table.py#L103) class exposes a [mutate_rows method](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/table.py#L690)
> - The method takes in a list of [DirectRow](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/row.py#L252) instances
> - The method builds a [_RetryableMutateRowsWorker](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/table.py#L1067), and then [calls it](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/table.py#L739) with a retry object
> - The majority of the mutate_rows logic happens in [_RetryableMutateRowsWorker._do_retryable_rows](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/table.py#L1113), which is [wrapped in](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/table.py#L1096) [api_core.Retry logic](https://github.com/googleapis/python-api-core/blob/a5648faf31c30158d59a3127ea37f7c9911ff765/google/api_core/retry/retry_unary.py#L169)
> - [Retryable errors](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/table.py#L62) are handled by the retry wrapper (which can also contain [its own user-provided retryable errors](https://github.com/googleapis/python-api-core/blob/a5648faf31c30158d59a3127ea37f7c9911ff765/google/api_core/retry/retry_base.py#L237))
> - Any failed mutations with retryable errors will be tried again, until the deadline is hit
> - Table.mutate_rows returns a list of Status protos, one for each mutation attempted
> - If the rpc hits a non-retryable error, the exception is raised immediately
> - If the rpc times-out without any responses, it returns a list of `None`s
>
> Replacement
> - We can replace [_RetryableMutateRowsWorker](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/table.py#L1067) with a new implementation that defers all work to the data client’s internal [_MutateRowsOperation class](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py#L38)
> - [DirectRows](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/row.py#L252) will have to be converted to corresponding [RowMutationEntries](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/data/mutations.py#L279)
> - We catch any [MutateExceptionGroup](https://github.com/googleapis/python-bigtable/blob/7cab3e88b7c7e880d7ecaa574f70a88fe35c700f/google/cloud/bigtable/data/exceptions.py#L144) exceptions, and build a status dict to return instead
> - If no exceptions are raised, return a list of Status.OK results

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.