Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0f7a42

Browse files
committed
Attempt prism for pipelines with unbounded PCollections.
Also fix error with terminal state checking.
1 parent d0def26 commit f0f7a42

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sdks/python/apache_beam/runners/direct/direct_runner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ def visit_transform(self, applied_ptransform):
110110
if timer.time_domain == TimeDomain.REAL_TIME:
111111
self.supported_by_fnapi_runner = False
112112

113+
def visit_value(self, value, producer_node):
114+
if not value.is_bounded:
115+
self.supported_by_fnapi_runner = False
116+
113117
class _PrismRunnerSupportVisitor(PipelineVisitor):
114118
"""Visitor determining if a Pipeline can be run on the PrismRunner."""
115119
def accept(self, pipeline):
@@ -167,7 +171,8 @@ def visit_transform(self, applied_ptransform):
167171
pr = runner.run_pipeline(pipeline, options)
168172
# This is non-blocking, so if the state is *already* finished, something
169173
# probably failed on job submission.
170-
if pr.state.is_terminal() and pr.state != PipelineState.DONE:
174+
if (PipelineState.is_terminal(pr.state) and
175+
pr.state != PipelineState.DONE):
171176
_LOGGER.info(
172177
'Pipeline failed on PrismRunner, falling back toDirectRunner.')
173178
runner = BundleBasedDirectRunner()

0 commit comments

Comments
 (0)