KevinGG commented on a change in pull request #15490:
URL: https://github.com/apache/beam/pull/15490#discussion_r707624568
##########
File path:
sdks/python/apache_beam/runners/interactive/display/pcoll_visualization.py
##########
@@ -236,6 +239,30 @@ def continuous_update_display(): # pylint:
disable=unused-variable
return None
+def visualize_computed_pcoll(
+ pcoll_name: str, pcoll: beam.pvalue.PValue) -> None:
+ """A simple visualize alternative.
+
+ When the pcoll_name and pcoll pair identifies a watched and computed
+ PCollection in the current interactive environment without ambiguity, an
+ ElementStream can be built directly from cache.
+ """
+ try:
+ pipeline = ie.current_env().user_pipeline(pcoll.pipeline)
+ cache_manager = ie.current_env().get_cache_manager(pipeline)
+ cache_key = CacheKey.from_pcoll(pcoll_name, pcoll).to_str()
+ reader, _ = cache_manager.read('full', cache_key)
+ visualize(
+ ElementStream(pcoll, pcoll_name, cache_key, float('inf'),
float('inf')),
+ element_type=pcoll.element_type)
Review comment:
Acked, will move it to RecordingManager.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]