ajamato commented on pull request #15562: URL: https://github.com/apache/beam/pull/15562#issuecomment-926001201
> Hi, @ajamato would you help me to review this? > I create a new class to override `flush` method in `MutationsBatcher` so I can get the rows response of `table.mutate_rows`. > Each row has a google.rpc.status_pb2.Status for some of these codes https://cloud.google.com/bigtable/docs/status-codes is still missing how I can handle the grpc status codes because service_call_metrics is expecting int httpStatus or string status, but here the `grpc` status is an integer (0-14). > https://github.com/apache/beam/blob/82f08b4dabc923151683f69cde71372755c7227c/sdks/python/apache_beam/io/gcp/bigtableio.py#L124 Is there is a method on the status object to get the string status "ok", "cancelled" "invalid_argument", etc. use that. (ServiceCallMetric will lowercase it) If there is only a way to obtain the numbers: https://cloud.google.com/bigtable/docs/status-codes 0 (OK) 1 (CANCELLED) 2 (UNKNOWN) ... Then please write a helper function to lookup the number from a map and convert it to a string. Lookup the string with that helper function before the call to service_metric.call() i.e. grpc_status_string = convert_to_grpc_status_string(status.code()) service_metric.call(grpc_status_string) -- 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]
