You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mitigated by excluding the certain version. Remain open to investigate the root cause (either a client bug or intended client change that can be solved by changing the test).
Yeah, I planned to do. Also notified bigtable maintainers. I wished to extract a minimum working example showing what previously worked now break, from the unit test, just haven't get into it
In detail, Beam extends the client MutationsBatcher as a _MutationsBatcher, which overwrites its member rows. In newer version, this member is renamed as private (_rows) so iiuc current design would no longer work. Python BigtableIO is broken in google-cloud-bigtable>=2.18.0
Thanks @Abacn for looking into this. We're not sure why bigtableio.py overrides MutationsBatcher. I wonder if using the batcher from python client here:
I think the _MutationBatcher wrapper was created because of 2 reasons:
in batcher client implementation < 2.18.0, if some mutations failed and the RPC succeeded, batcher will not return any errors. _MutationBatcher wrapper addresses this issue so mutations don't silently fail.
Activity
Abacn commentedon May 11, 2023
Change to P1 because this is a precommit permared
Abacn commentedon May 11, 2023
Found the cause: google-cloud-bigtable==2.18.0 breaks the test:
To reproduce: in sdks/python run command:
Abacn commentedon May 11, 2023
With google-cloud-bigtable=2.18.0, query runner api monitoring infos returns an empty dict here:
https://github.com/apache/beam/blob/2209da6c084c224462bea947c428942c2f6efcce/sdks/python/apache_beam/io/gcp/bigtableio_test.py#LL116C54-L116C54
WIth google-cloud-bigtable=2.17.0,
MetricsEnvironment.process_wide_container().to_runner_api_monitoring_infos(None)returns a dict like this:Abacn commentedon May 12, 2023
mitigated by excluding the certain version. Remain open to investigate the root cause (either a client bug or intended client change that can be solved by changing the test).
12 remaining items
Abacn commentedon May 16, 2023
opened #26717
tvalentyn commentedon May 18, 2023
thanks a lot, do we need to open an issue in https://github.com/googleapis/python-bigtable/issues?
Abacn commentedon May 18, 2023
Yeah, I planned to do. Also notified bigtable maintainers. I wished to extract a minimum working example showing what previously worked now break, from the unit test, just haven't get into it
Abacn commentedon May 23, 2023
The cause is the member MutationsBatcher.rows changed its name to MutationsBatcher._rows in googleapis/python-bigtable#722 , so
beam/sdks/python/apache_beam/io/gcp/bigtableio.py
Line 68 in 7539ab3
is always false.
In detail, Beam extends the client
MutationsBatcheras a_MutationsBatcher, which overwrites its memberrows. In newer version, this member is renamed as private (_rows) so iiuc current design would no longer work. Python BigtableIO is broken in google-cloud-bigtable>=2.18.0tvalentyn commentedon May 23, 2023
given that we pre install this IO dep in containers, would our users be affected?
tvalentyn commentedon May 23, 2023
in other words, does this matter also at job submission or only at runtime?
Abacn commentedon May 23, 2023
Users using our published containers won't get affected (e.g. typical Dataflow use case) as it pre-installed google-cloud-bigtable < 2.18
Users build custom container after May 10 will be affected (google-cloud-bigtable 2.18 added to the container)
Should only affects run time.
_MutationsBatcheris constructed in start_bundle (pipeline run time) so submission time dependency does not affect itmutianf commentedon May 25, 2023
Thanks @Abacn for looking into this. We're not sure why bigtableio.py overrides MutationsBatcher. I wonder if using the batcher from python client here:
beam/sdks/python/apache_beam/io/gcp/bigtableio.py
Line 171 in 7539ab3
Abacn commentedon May 25, 2023
Yeah, deriving from client MutationsBatcher sounds not a good idea to me either, especially in Python where class is too flexible
mutianf commentedon May 25, 2023
I think the _MutationBatcher wrapper was created because of 2 reasons:
The first issue is fixed in the 2.18.0 client. So we shouldn't need to wrap the MutationBatcher anymore. We can get the exception count from https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/batcher.py#L382 and update the metrics in finishBundle.
I'll work on a fix soon!