damccorm commented on code in PR #23830:
URL: https://github.com/apache/beam/pull/23830#discussion_r1004758623
##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -426,17 +427,22 @@ def setup(self):
def process(self, batch, inference_args):
start_time = _to_microseconds(self._clock.time_ns())
- result_generator = self._model_handler.run_inference(
+ try:
+ result_generator = self._model_handler.run_inference(
batch, self._model, inference_args)
- predictions = list(result_generator)
+ except BaseException:
+ self._metrics_collector.failed_batches_counter.inc()
+ raise
+ else:
Review Comment:
We don't need to nest this clause in an else clause when we're raising the
exception. The exception will keep it from executing
--
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]