shunping opened a new pull request, #40029: URL: https://github.com/apache/beam/pull/40029
## 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. (https://github.com/googleapis/google-cloud-python/commit/990f86e45df15c594e82d19d6fe482f12d128430#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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
