Skip to content

Commit 8cc26a4

Browse files
authored
fix circular PipelineGraph import (#37134)
* move import * fix pylint
1 parent 7a2a5bf commit 8cc26a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sdks/python/apache_beam/runners/interactive/recording_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
from apache_beam.runners.interactive import pipeline_fragment as pf
4242
from apache_beam.runners.interactive import utils
4343
from apache_beam.runners.interactive.caching.cacheable import CacheKey
44-
from apache_beam.runners.interactive.display.pipeline_graph import PipelineGraph
4544
from apache_beam.runners.interactive.options import capture_control
4645
from apache_beam.runners.runner import PipelineState
4746

@@ -713,6 +712,10 @@ def _get_pipeline_graph(self):
713712
"""Lazily initializes and returns the PipelineGraph."""
714713
if self._pipeline_graph is None:
715714
try:
715+
# Allow initial module loading to be complete and not have a circular
716+
# import.
717+
from apache_beam.runners.interactive.display.pipeline_graph import PipelineGraph
718+
716719
# Try to create the graph.
717720
self._pipeline_graph = PipelineGraph(self.user_pipeline)
718721
except (ImportError, NameError, AttributeError):

0 commit comments

Comments
 (0)