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 2022/05/27 19:34:05 UTC
[GitHub] [beam] ahmedabu98 commented on a diff in pull request #17774: Fix NonType error when importing google.api_core fails
ahmedabu98 commented on code in PR #17774:
URL: https://github.com/apache/beam/pull/17774#discussion_r883930114
##########
sdks/python/apache_beam/io/gcp/bigquery_test.py:
##########
@@ -858,19 +858,19 @@ class BigQueryStreamingInsertsErrorHandling(unittest.TestCase):
# to determine error types and messages to try for retriables.
@parameterized.expand([
param(
- exception_type=exceptions.Forbidden,
+ exception_type=exceptions.Forbidden if exceptions else None,
error_reason='rateLimitExceeded'),
param(
- exception_type=exceptions.DeadlineExceeded,
+ exception_type=exceptions.DeadlineExceeded if exceptions else None,
error_reason='somereason'),
param(
- exception_type=exceptions.ServiceUnavailable,
+ exception_type=exceptions.ServiceUnavailable if exceptions else None,
error_reason='backendError'),
param(
- exception_type=exceptions.InternalServerError,
+ exception_type=exceptions.InternalServerError if exceptions else None,
error_reason='internalError'),
param(
- exception_type=exceptions.InternalServerError,
+ exception_type=exceptions.InternalServerError if exceptions else None,
Review Comment:
Do these tests still run if empty params are passed in? Would it be more optimal to skip them entirely? Something like this in the beginning of each affected test:
```
if exceptions is None:
self.skipTest("Import fail: google.api_core")
```
--
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