This is an automated email from the ASF dual-hosted git repository.
shunping pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new fe9c78a7e8c fix interactive environment circular import (#37147)
fe9c78a7e8c is described below
commit fe9c78a7e8c0b89e68a0555b43f21ab36dcf6dcf
Author: Derrick Williams <[email protected]>
AuthorDate: Thu Dec 18 15:31:00 2025 -0500
fix interactive environment circular import (#37147)
* fix interactive enviornemnt circular import
* remove unnecessary protection for circular import
---
.../apache_beam/runners/interactive/interactive_environment.py | 5 ++++-
sdks/python/apache_beam/runners/interactive/recording_manager.py | 5 +----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/sdks/python/apache_beam/runners/interactive/interactive_environment.py
b/sdks/python/apache_beam/runners/interactive/interactive_environment.py
index 2a8fc23088a..bfb1a7f1190 100644
--- a/sdks/python/apache_beam/runners/interactive/interactive_environment.py
+++ b/sdks/python/apache_beam/runners/interactive/interactive_environment.py
@@ -38,7 +38,6 @@ from apache_beam.runners import runner
from apache_beam.runners.direct import direct_runner
from apache_beam.runners.interactive import cache_manager as cache
from
apache_beam.runners.interactive.messaging.interactive_environment_inspector
import InteractiveEnvironmentInspector
-from apache_beam.runners.interactive.recording_manager import RecordingManager
from apache_beam.runners.interactive.sql.sql_chain import SqlChain
from apache_beam.runners.interactive.user_pipeline_tracker import
UserPipelineTracker
from apache_beam.runners.interactive.utils import assert_bucket_exists
@@ -428,6 +427,10 @@ class InteractiveEnvironment(object):
def get_recording_manager(self, pipeline, create_if_absent=False):
"""Gets the recording manager for the given pipeline."""
+ # Allow initial module loading to be complete and not have a circular
+ # import.
+ from apache_beam.runners.interactive.recording_manager import
RecordingManager
+
recording_manager = self._recording_managers.get(str(id(pipeline)), None)
if not recording_manager and create_if_absent:
# Get the pipeline variable name for the user. This is useful if the user
diff --git a/sdks/python/apache_beam/runners/interactive/recording_manager.py
b/sdks/python/apache_beam/runners/interactive/recording_manager.py
index 688d71bada2..c19b60b64fd 100644
--- a/sdks/python/apache_beam/runners/interactive/recording_manager.py
+++ b/sdks/python/apache_beam/runners/interactive/recording_manager.py
@@ -41,6 +41,7 @@ from apache_beam.runners.interactive import
interactive_runner as ir
from apache_beam.runners.interactive import pipeline_fragment as pf
from apache_beam.runners.interactive import utils
from apache_beam.runners.interactive.caching.cacheable import CacheKey
+from apache_beam.runners.interactive.display.pipeline_graph import
PipelineGraph
from apache_beam.runners.interactive.options import capture_control
from apache_beam.runners.runner import PipelineState
@@ -712,10 +713,6 @@ class RecordingManager:
"""Lazily initializes and returns the PipelineGraph."""
if self._pipeline_graph is None:
try:
- # Allow initial module loading to be complete and not have a circular
- # import.
- from apache_beam.runners.interactive.display.pipeline_graph import
PipelineGraph
-
# Try to create the graph.
self._pipeline_graph = PipelineGraph(self.user_pipeline)
except (ImportError, NameError, AttributeError):