Skip to content

Fix Bigtable Tests for google-cloud-bigtable >= 2.44.0 - #40029

Open
shunping wants to merge 1 commit into
apache:masterfrom
shunping:fix-bigtableio-tests
Open

Fix Bigtable Tests for google-cloud-bigtable >= 2.44.0#40029
shunping wants to merge 1 commit into
apache:masterfrom
shunping:fix-bigtableio-tests

Conversation

@shunping

@shunping shunping commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes unit test and runtime failures in apache_beam/io/gcp/bigtableio.py with google-cloud-bigtable >= 2.44.0.
In google-cloud-bigtable >= 2.44.0, DirectRow._get_mutations() returns Python RowMutationEntry dataclass objects (SetCell, DeleteRangeFromColumn, DeleteAllFromFamily, DeleteAllFromRow) instead of raw google.cloud.bigtable_v2.types.data.Mutation protobuf messages. (googleapis/google-cloud-python@990f86e#diff-7f9a11d9f6bc7583fcd21212c25030948b23bcd4ba7c93caa0db6f6b7d886c8bR290)

Because these dataclasses do not implement __contains__, checking oneof fields in _DirectRowMutationsToBeamRow.process raised AttributeError: '...' object has no attribute '__contains__'.

This PR updates _DirectRowMutationsToBeamRow.process and TestBigtableDirectRowToBeamRow to call DirectRow._get_mutation_pbs() when available to retrieve Mutation protobuf messages, falling back to DirectRow._get_mutations() for older google-cloud-bigtable versions.

fixes #34739

@shunping

shunping commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

r: @Amar3tto

@shunping
shunping marked this pull request as ready for review September 5, 2026 03:44
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The PreCommit Python job is flaky

1 participant