apache_beam.runners.direct.test_direct_runner module

Wrapper of Beam runners that’s built for running and verifying e2e tests.

class apache_beam.runners.direct.test_direct_runner.TestDirectRunner[source]

Bases: apache_beam.runners.direct.direct_runner.SwitchingDirectRunner

run_pipeline(pipeline, options)[source]

Execute test pipeline and verify test matcher

apply(transform, input, options)

Runner callback for a pipeline.apply call.

Parameters:
  • transform – the transform to apply.
  • input – transform’s input (typically a PCollection).

A concrete implementation of the Runner class may want to do custom pipeline construction for a given transform. To override the behavior for a transform class Xyz, implement an apply_Xyz method with this same signature.

apply_PTransform(transform, input, options)
is_fnapi_compatible()
run(transform, options=None)

Run the given transform or callable with this runner.

Blocks until the pipeline is complete. See also PipelineRunner.run_async.

run_async(transform, options=None)

Run the given transform or callable with this runner.

May return immediately, executing the pipeline in the background. The returned result object can be queried for progress, and wait_until_finish may be called to block until completion.

run_transform(transform_node, options)

Runner callback for a pipeline.run call.

Parameters:transform_node – transform node for the transform to run.

A concrete implementation of the Runner class must implement run_Abc for some class Abc in the method resolution order for every non-composite transform Xyz in the pipeline.

visit_transforms(pipeline, options)