You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/09/28 20:28:31 UTC

[GitHub] [beam] ajamato commented on a change in pull request #15562: [BEAM-11985] Python Bigtable - Implement IO Request Count metrics

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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org