ajamato commented on a change in pull request #15562:
URL: https://github.com/apache/beam/pull/15562#discussion_r717925985



##########
File path: sdks/python/apache_beam/internal/metrics/metric.py
##########
@@ -223,3 +223,31 @@ def convert_to_canonical_status_string(self, status):
         http_status_code in http_to_canonical_gcp_status):
       return http_to_canonical_gcp_status[http_status_code]
     return str(http_status_code)
+
+  @staticmethod
+  def convert_to_grpc_status_string(grpc_status):

Review comment:
       please rename variable grpc_status -> grpc_status_code

##########
File path: sdks/python/apache_beam/internal/metrics/metric.py
##########
@@ -223,3 +223,31 @@ def convert_to_canonical_status_string(self, status):
         http_status_code in http_to_canonical_gcp_status):
       return http_to_canonical_gcp_status[http_status_code]
     return str(http_status_code)
+
+  @staticmethod
+  def convert_to_grpc_status_string(grpc_status):
+    # type: (int) -> str
+
+    """Converts a grpc status to a canonical GCP status code string."""

Review comment:
       Replace this comment
   """
   Converts the bigtable error code to a canonical GCP status code string.
   
   This Bigtable client library is not using the canonical http status code 
values (i.e. https://cloud.google.com/apis/design/errors)"
   Instead they are numbered using an enum with these values corresponding to 
each status code:
   https://cloud.google.com/bigtable/docs/status-codes
   """
   
   Please also add Args and Returns pydoc comment

##########
File path: sdks/python/apache_beam/internal/metrics/metric.py
##########
@@ -223,3 +223,31 @@ def convert_to_canonical_status_string(self, status):
         http_status_code in http_to_canonical_gcp_status):
       return http_to_canonical_gcp_status[http_status_code]
     return str(http_status_code)
+
+  @staticmethod
+  def convert_to_grpc_status_string(grpc_status):

Review comment:
       please rename function to:
   bigtable_error_code_to_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]


Reply via email to