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

Skip to content

Commit c70404a

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

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,11 @@ 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+
117+
113118
class _PrismRunnerSupportVisitor(PipelineVisitor):
114119
"""Visitor determining if a Pipeline can be run on the PrismRunner."""
115120
def accept(self, pipeline):
@@ -167,7 +172,7 @@ def visit_transform(self, applied_ptransform):
167172
pr = runner.run_pipeline(pipeline, options)
168173
# This is non-blocking, so if the state is *already* finished, something
169174
# probably failed on job submission.
170-
if pr.state.is_terminal() and pr.state != PipelineState.DONE:
175+
if (PipelineState.is_terminal(pr.state) and pr.state != PipelineState.DONE):
171176
_LOGGER.info(
172177
'Pipeline failed on PrismRunner, falling back toDirectRunner.')
173178
runner = BundleBasedDirectRunner()

0 commit comments

Comments
 (0)