aaltay commented on a change in pull request #16449:
URL: https://github.com/apache/beam/pull/16449#discussion_r780016504
##########
File path: sdks/python/apache_beam/internal/metrics/metric.py
##########
@@ -262,4 +262,8 @@ def
bigtable_error_code_to_grpc_status_string(grpc_status_code):
if (grpc_status_code is not None and
grpc_status_code in grpc_to_canonical_gcp_status):
return grpc_to_canonical_gcp_status[grpc_status_code]
+ if grpc_status_code is None:
+ # Bigtable indicates this can be retried but itself has exhausted retry
+ # timeout or there is no retry policy set for bigtable.
+ return grpc_to_canonical_gcp_status[4]
Review comment:
I do not fully understand why are we mapping this to deadline exceeded?
##########
File path: sdks/python/apache_beam/internal/metrics/metric.py
##########
@@ -262,4 +262,8 @@ def
bigtable_error_code_to_grpc_status_string(grpc_status_code):
if (grpc_status_code is not None and
grpc_status_code in grpc_to_canonical_gcp_status):
return grpc_to_canonical_gcp_status[grpc_status_code]
+ if grpc_status_code is None:
Review comment:
If you move this above the previous if, you can simplify the other if by
removing the `is not None` part.
##########
File path: sdks/python/apache_beam/io/gcp/bigtableio.py
##########
@@ -116,11 +116,13 @@ def __setstate__(self, options):
self.service_call_metric = None
self.written = Metrics.counter(self.__class__, 'Written Row')
- def write_mutate_metrics(self, rows):
- for status in rows:
+ def write_mutate_metrics(self, response):
Review comment:
If metric gathering fails for any reason, IO will still fail right?
(This is probably ok, but just checking since PR title says it will be
prevented.)
--
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]