Skip to content

feat(bigtable): Rerouted CheckAndMutateRows and ReadModifyWriteRows to data client - #18190

Draft
daniel-sanche wants to merge 3 commits into
mainfrom
shim/06-conditional-mutations
Draft

feat(bigtable): Rerouted CheckAndMutateRows and ReadModifyWriteRows to data client#18190
daniel-sanche wants to merge 3 commits into
mainfrom
shim/06-conditional-mutations

Conversation

@daniel-sanche

Copy link
Copy Markdown
Contributor

Migrating over @gkevinzheng PR from bigtable monorepo googleapis/python-bigtable#1257

Original description:

Changes made:

  • Row objects hold Mutation and ReadModifyWriteRowRule objects from the data client rather than raw protos.
  • Rerouted ConditionalRow.commit and AppendRow.commit (CheckAndMutateRows and ReadModifyWriteRows respectively) to use the data client, or more specifically, self._table._table_impl
  • Added function DirectRow._to_mutation_pbs for retrieving mutations in proto form for the current MutateRows implementation, as well as for DirectRow.get_mutations_size.
  • Removed unnecessary helper functions and tests for helper functions

Note to reviewers: This PR has already been reviewed and merged to a staging branch, with the intention of doing a single merge to main. We are now planning to slowly rollout these changes back to the main branch. Minimal re-review should be necessary

@daniel-sanche
daniel-sanche requested a review from a team as a code owner August 21, 2026 18:59

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Bigtable row and row filter implementations to delegate to the new data client (google.cloud.bigtable.data) instead of constructing legacy v2 protobufs directly, while maintaining backwards compatibility. The review feedback points out a critical runtime AttributeError in the mock _Table class within the unit tests, and suggests adding a descriptive error message to the AttributeError raised by _MappableAttributesMixin.__getattr__ to improve debuggability.

Comment thread packages/google-cloud-bigtable/tests/unit/v2_client/test_row.py
Comment thread packages/google-cloud-bigtable/google/cloud/bigtable/row_filters.py
@daniel-sanche
daniel-sanche marked this pull request as draft August 21, 2026 19:08
gkevinzheng and others added 2 commits August 21, 2026 12:09
**Changes made:**

- `Row` objects hold `Mutation` and `ReadModifyWriteRowRule` objects
from the data client rather than raw protos.
- Rerouted `ConditionalRow.commit` and `AppendRow.commit`
(CheckAndMutateRows and ReadModifyWriteRows respectively) to use the
data client, or more specifically, `self._table._table_impl`
- Added function `DirectRow._to_mutation_pbs` for retrieving mutations
in proto form for the current `MutateRows` implementation, as well as
for `DirectRow.get_mutations_size`.
- Removed unnecessary helper functions and tests for helper functions
@daniel-sanche
daniel-sanche force-pushed the shim/06-conditional-mutations branch from ad30839 to c1a1d03 Compare August 21, 2026 19:09
@daniel-sanche

Copy link
Copy Markdown
Contributor Author

We can ignore the import profiler checks here. It is expected that imports will be a bit slower at first, since we are pulling in the data client (over time, we will be removing legacy client classes to make up for it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants