ajdub508 commented on code in PR #28091:
URL: https://github.com/apache/beam/pull/28091#discussion_r1327052981


##########
sdks/python/apache_beam/io/gcp/bigquery_tools.py:
##########
@@ -1491,7 +1493,29 @@ class RetryStrategy(object):
   RETRY_NEVER = 'RETRY_NEVER'
   RETRY_ON_TRANSIENT_ERROR = 'RETRY_ON_TRANSIENT_ERROR'
 
-  _NON_TRANSIENT_ERRORS = {'invalid', 'invalidQuery', 'notImplemented'}
+  # Values below may be found in reasons provided either in an
+  # error returned by a client method or by an http response as
+  # defined in google.api_core.exceptions
+  _NON_TRANSIENT_ERRORS = {
+      'invalid',
+      'invalidQuery',
+      'notImplemented',
+      'Moved Permanently',
+      'Not Modified',
+      'Temporary Redirect',
+      'Resume Incomplete',
+      'Bad Request',
+      'Unauthorized',
+      'Forbidden',
+      'Not Found',
+      'Method Not Allowed',
+      'Conflict',
+      'Length Required',
+      'Precondition Failed',
+      'Not Implemented',
+      'Bad Gateway',
+      'Gateway Timeout',
+  }

Review Comment:
   > Also error reasons from BQ seem to appear in camel case format (e.g. 
`notFound` instead of `Not Found`). Is it different for GRPC errors?
   
   Posted this in a different comment but will include here to make it easy to 
follow in this thread - 
   
   There are 2 types of error reasons in that list:
   1. Reasons returned in the error list response of the 
`self.gcp_bq_client.insert_rows_json` call. Those are in camel case and are the 
ones found here in this doc - 
https://cloud.google.com/bigquery/docs/error-messages.
   2. Reasons returned by the `GoogleAPICalError` exceptions. Those follow the 
HTTP standard reason format. A 404, for example will return a reason of `Not 
Found`, which is verified with [this integration 
test](https://github.com/apache/beam/pull/28091/files#diff-b6e14063dc720a5be1a68c935803f399ab5301bc3748c7f46f156b0c80f5d691R484).



-- 
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