apache_beam.runners.interactive.interactive_pipeline_graph module

Helper to render pipeline graph in IPython when running interactively.

This module is experimental. No backwards-compatibility guarantees.

apache_beam.runners.interactive.interactive_pipeline_graph.nice_str(o)[source]
apache_beam.runners.interactive.interactive_pipeline_graph.format_sample(contents, count=1000)[source]
class apache_beam.runners.interactive.interactive_pipeline_graph.InteractivePipelineGraph(pipeline_proto, required_transforms=None, referenced_pcollections=None, cached_pcollections=None, pcollection_stats=None)[source]

Bases: apache_beam.runners.interactive.pipeline_graph.PipelineGraph

Creates the DOT representation of an interactive pipeline. Thread-safe.

Constructor of PipelineGraph.

Examples

pipeline_graph = PipelineGraph(pipeline_proto) print(pipeline_graph.get_dot()) pipeline_graph.display_graph()

Parameters:
  • pipeline_proto – (Pipeline proto) Pipeline to be rendered.
  • required_transforms – (dict from str to PTransform proto) Mapping from transform ID to transforms that leads to visible results.
  • referenced_pcollections – (dict from str to PCollection proto) PCollection ID mapped to PCollection referenced during pipeline execution.
  • cached_pcollections – (set of str) A set of PCollection IDs of those whose cached results are used in the execution.
display_graph()[source]

Displays graph via IPython or prints DOT if not possible.