Skip to content

Commit 2b5ffc7

Browse files
Distinguishing bigquery logging failures severities (#35373)
1 parent 36e233c commit 2b5ffc7

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

sdks/python/apache_beam/io/gcp/bigquery.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,11 +1768,14 @@ def _flush_batch(self, destination):
17681768
'Errors were {}'.format(("" if should_retry else " not"), errors))
17691769

17701770
# The log level is:
1771-
# - WARNING when we are continuing to retry, and have a deadline.
1772-
# - ERROR when we will no longer retry, or MAY retry forever.
1773-
log_level = (
1774-
logging.WARN if should_retry or self._retry_strategy
1775-
!= RetryStrategy.RETRY_ALWAYS else logging.ERROR)
1771+
# - WARNING when should_retry is true, else ERROR.
1772+
1773+
if (should_retry and
1774+
self._retry_strategy in [RetryStrategy.RETRY_ON_TRANSIENT_ERROR,
1775+
RetryStrategy.RETRY_ALWAYS]):
1776+
log_level = logging.WARN
1777+
else:
1778+
log_level = logging.ERROR
17761779

17771780
_LOGGER.log(log_level, message)
17781781

0 commit comments

Comments
 (0)