From ed9720411d0b74cc3019df3dce5606bf9d4a8858 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Mon, 12 May 2025 17:01:31 -0400 Subject: [PATCH 1/2] Correctly auto-enable prism for any pipelines --- sdks/python/apache_beam/runners/direct/direct_runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/runners/direct/direct_runner.py b/sdks/python/apache_beam/runners/direct/direct_runner.py index 8b8937653688..1df2e88f6140 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 @@ def visit_transform(self, applied_ptransform): 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() From f403daca81d0aec979729f5659e75154b21b2321 Mon Sep 17 00:00:00 2001 From: Danny Mccormick Date: Tue, 13 May 2025 09:45:28 -0400 Subject: [PATCH 2/2] CHANGES --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 6dd8504db794..916fc4f26f39 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 ## Breaking Changes