Skip to content

Commit

Permalink
Additional context for decoding errors. (#27024)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwb authored Oct 9, 2023
1 parent 21f822f commit f63e9ed
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sdks/python/apache_beam/runners/worker/bundle_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,13 @@ def process_encoded(self, encoded_windowed_values):
if self.index == self.stop - 1:
return
self.index += 1
decoded_value = self.windowed_coder_impl.decode_from_stream(
input_stream, True)
try:
decoded_value = self.windowed_coder_impl.decode_from_stream(
input_stream, True)
except Exception as exn:
raise ValueError(
"Error decoding input stream with coder " +
self.windowed_coder) from exn
self.output(decoded_value)

def monitoring_infos(self, transform_id, tag_to_pcollection_id):
Expand Down

0 comments on commit f63e9ed

Please sign in to comment.