This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch users/damccorm/prism-external
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 875ff82ccd936e5008b194c6c596fc5ea27dea9e
Author: Danny Mccormick <[email protected]>
AuthorDate: Thu Sep 4 10:04:58 2025 -0400

    Correctly exclude prism when using external transforms
---
 sdks/python/apache_beam/runners/direct/direct_runner.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/sdks/python/apache_beam/runners/direct/direct_runner.py 
b/sdks/python/apache_beam/runners/direct/direct_runner.py
index 0af0ca8d317..487d2a8cbe2 100644
--- a/sdks/python/apache_beam/runners/direct/direct_runner.py
+++ b/sdks/python/apache_beam/runners/direct/direct_runner.py
@@ -137,6 +137,14 @@ class SwitchingDirectRunner(PipelineRunner):
           self.supported_by_prism_runner = False
         else:
           pipeline.visit(self)
+        # Avoid circular import
+        from apache_beam.pipeline import ExternalTransformFinder
+        if ExternalTransformFinder.contains_external_transforms(pipeline):
+          # TODO(https://github.com/apache/beam/issues/33623): Prism currently
+          # seems to not be able to consistently bring up external transforms.
+          # It does sometimes, but at volume suites start to fail. We will try
+          # to enable this in a future release.
+          self.supported_by_prism_runner = False
         return self.supported_by_prism_runner
 
       def visit_transform(self, applied_ptransform):
@@ -145,12 +153,6 @@ class SwitchingDirectRunner(PipelineRunner):
         # being used.
         if isinstance(transform, TestStream):
           self.supported_by_prism_runner = False
-        if isinstance(transform, beam.ExternalTransform):
-          # TODO(https://github.com/apache/beam/issues/33623): Prism currently
-          # seems to not be able to consistently bring up external transforms.
-          # It does sometimes, but at volume suites start to fail. We will try
-          # to enable this in a future release.
-          self.supported_by_prism_runner = False
         if isinstance(transform, beam.ParDo):
           dofn = transform.dofn
           # TODO(https://github.com/apache/beam/issues/33623): Prism currently

Reply via email to