Skip to content

Commit

Permalink
Fix exception sampling logic (#33076)
Browse files Browse the repository at this point in the history
* Fix exception sampling logic

* Allow subclasses of BaseException

* Mock cython if not present

* Use correct types/names

* format
  • Loading branch information
damccorm authored Nov 11, 2024
1 parent 47740d0 commit c6549e7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdks/python/apache_beam/runners/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,8 +1504,7 @@ def process(self, windowed_value):
return []

def _maybe_sample_exception(
self, exn: BaseException,
windowed_value: Optional[WindowedValue]) -> None:
self, exc_info: Tuple, windowed_value: Optional[WindowedValue]) -> None:

if self.execution_context is None:
return
Expand All @@ -1516,7 +1515,7 @@ def _maybe_sample_exception(

output_sampler.sample_exception(
windowed_value,
exn,
exc_info,
self.transform_id,
self.execution_context.instruction_id)

Expand Down

0 comments on commit c6549e7

Please sign in to comment.