Skip to content

Commit

Permalink
Catch a broad Exception when setting _BeamPipeline.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 617013620
  • Loading branch information
tfx-copybara committed Mar 19, 2024
1 parent 2283b52 commit 281ddf5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tfx/dsl/component/experimental/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import apache_beam as beam # pytype: disable=import-error # pylint: disable=g-import-not-at-top

_BeamPipeline = beam.Pipeline
except ModuleNotFoundError:
except Exception: # pylint: disable=broad-exception-caught
beam = None
_BeamPipeline = Any

Expand Down
2 changes: 1 addition & 1 deletion tfx/dsl/component/experimental/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
try:
import apache_beam as beam # pytype: disable=import-error # pylint: disable=g-import-not-at-top
_BeamPipeline = beam.Pipeline
except ModuleNotFoundError:
except Exception: # pylint: disable=broad-exception-caught
beam = None
_BeamPipeline = Any

Expand Down
2 changes: 1 addition & 1 deletion tfx/dsl/component/experimental/function_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
try:
import apache_beam as beam # pytype: disable=import-error # pylint: disable=g-import-not-at-top
_BeamPipeline = beam.Pipeline
except ModuleNotFoundError:
except Exception: # pylint: disable=broad-exception-caught
beam = None
_BeamPipeline = Any

Expand Down
2 changes: 1 addition & 1 deletion tfx/dsl/components/base/base_beam_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
try:
import apache_beam as beam # pytype: disable=import-error # pylint: disable=g-import-not-at-top
_BeamPipeline = beam.Pipeline
except ModuleNotFoundError:
except Exception: # pylint: disable=broad-exception-caught
beam = None
_BeamPipeline = Any

Expand Down

0 comments on commit 281ddf5

Please sign in to comment.