This is an automated email from the ASF dual-hosted git repository.
xqhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 5f4efb10490 Correctly auto-enable prism for some pipelines (#34921)
5f4efb10490 is described below
commit 5f4efb104907cc8f899e85f1b761cd9f035ef9ba
Author: Danny McCormick <[email protected]>
AuthorDate: Wed May 14 12:41:12 2025 -0400
Correctly auto-enable prism for some pipelines (#34921)
* Correctly auto-enable prism for any pipelines
* CHANGES
---
CHANGES.md | 1 +
sdks/python/apache_beam/runners/direct/direct_runner.py | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/CHANGES.md b/CHANGES.md
index 8fcb0e1ba7e..7f5d38b4cf4 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -76,6 +76,7 @@
## New Features / Improvements
* X feature added (Java/Python)
([#X](https://github.com/apache/beam/issues/X)).
+* [Python] Prism runner now auto-enabled for some Python pipelines using the
direct runner ([#34921](https://github.com/apache/beam/pull/34921)).
* [YAML] WriteToTFRecord and ReadFromTFRecord Beam YAML support
* Python: Added JupyterLab 4.x extension compatibility for enhanced notebook
integration ([#34495](https://github.com/apache/beam/pull/34495)).
diff --git a/sdks/python/apache_beam/runners/direct/direct_runner.py
b/sdks/python/apache_beam/runners/direct/direct_runner.py
index 8b893765368..1df2e88f614 100644
--- a/sdks/python/apache_beam/runners/direct/direct_runner.py
+++ b/sdks/python/apache_beam/runners/direct/direct_runner.py
@@ -167,7 +167,8 @@ class SwitchingDirectRunner(PipelineRunner):
pr = runner.run_pipeline(pipeline, options)
# This is non-blocking, so if the state is *already* finished,
something
# probably failed on job submission.
- if pr.state.is_terminal() and pr.state != PipelineState.DONE:
+ if (PipelineState.is_terminal(pr.state) and
+ pr.state != PipelineState.DONE):
_LOGGER.info(
'Pipeline failed on PrismRunner, falling back toDirectRunner.')
runner = BundleBasedDirectRunner()